File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
src/packages/frontend/chat Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ export default function ChatInput({
67
67
[ ] ,
68
68
) ;
69
69
70
- const [ input , setInput ] = useState < string > ( ( ) => {
70
+ const [ input , setInput ] = useState < string > ( "" ) ;
71
+ useEffect ( ( ) => {
71
72
const dbInput = syncdb
72
73
?. get_one ( {
73
74
event : "draft" ,
@@ -79,9 +80,9 @@ export default function ChatInput({
79
80
// the db version is used when you refresh your browser while editing, or scroll up and down
80
81
// thus unmounting and remounting the currently editing message (due to virtualization).
81
82
// See https://github.com/sagemathinc/cocalc/issues/6415
82
- const input = dbInput ?? propsInput ;
83
- return input ;
84
- } ) ;
83
+ setInput ( dbInput ?? propsInput ) ;
84
+ } , [ date , sender_id , propsInput ] ) ;
85
+
85
86
const currentInputRef = useRef < string > ( input ) ;
86
87
const saveOnUnmountRef = useRef < boolean > ( true ) ;
87
88
Original file line number Diff line number Diff line change @@ -54,11 +54,10 @@ const DELETE_BUTTON = false;
54
54
const BLANK_COLUMN = ( xs ) => < Col key = { "blankcolumn" } xs = { xs } > </ Col > ;
55
55
56
56
const MARKDOWN_STYLE = undefined ;
57
- // const MARKDOWN_STYLE = { maxHeight: "300px", overflowY: "auto" };
58
57
59
58
const BORDER = "2px solid #ccc" ;
60
59
61
- const SHOW_EDIT_BUTTON_MS = 45000 ;
60
+ const SHOW_EDIT_BUTTON_MS = 15000 ;
62
61
63
62
const TRHEAD_STYLE_SINGLE : CSS = {
64
63
marginLeft : "15px" ,
@@ -448,7 +447,13 @@ export default function Message(props: Readonly<Props>) {
448
447
< Space direction = "horizontal" size = "small" wrap >
449
448
{ showEditButton ? (
450
449
< Tooltip
451
- title = "Edit this message. You can edit any past message by anybody at any time by double clicking on it. Previous versions are in the history."
450
+ title = {
451
+ < >
452
+ Edit this message. You can edit < b > any</ b > past message at
453
+ any time by double clicking on it. Fix other people's typos.
454
+ All versions are stored.
455
+ </ >
456
+ }
452
457
placement = "left"
453
458
>
454
459
< Button
@@ -613,7 +618,7 @@ export default function Message(props: Readonly<Props>) {
613
618
< Icon
614
619
name = "thumbs-up"
615
620
style = { {
616
- color : showOtherFeedback ? "darkred " : undefined ,
621
+ color : showOtherFeedback ? "darkblue " : undefined ,
617
622
} }
618
623
/>
619
624
</ Button >
@@ -627,7 +632,6 @@ export default function Message(props: Readonly<Props>) {
627
632
size = "small"
628
633
type = { "text" }
629
634
style = { {
630
- marginRight : "5px" ,
631
635
float : "right" ,
632
636
marginTop : "-4px" ,
633
637
color : is_viewers_message ? "white" : "#888" ,
You can’t perform that action at this time.
0 commit comments