Skip to content

Commit bf463da

Browse files
committed
note and slight workaround for a bug with chat; also don't show upload previes for markdown, since in some cases they are really annoying
1 parent 0735167 commit bf463da

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/packages/frontend/chat/input.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,17 @@ export default function ChatInput({
156156
enableMentions={true}
157157
submitMentionsRef={submitMentionsRef}
158158
onChange={(input) => {
159+
/* BUG: in Markdown mode this stops getting
160+
called after you paste in an image. It works
161+
fine in Slate/Text mode. See
162+
https://github.com/sagemathinc/cocalc/issues/7728
163+
*/
159164
setInput(input);
160165
saveChat(input);
161166
}}
162167
onShiftEnter={(input) => {
168+
setInput(input);
169+
saveChat(input);
163170
saveChat.cancel();
164171
on_send(input);
165172
}}

src/packages/frontend/editors/slate/upload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ export default function useUpload(
9898

9999
return (
100100
<BlobUpload
101+
show_upload={false}
101102
className="smc-vfill"
102103
project_id={project_id}
103104
event_handlers={updloadEventHandlers}
104105
style={{ height: "100%", width: "100%" }}
105106
dropzone_ref={dropzoneRef}
106-
show_upload={true}
107107
>
108108
{body}
109109
</BlobUpload>

src/packages/jupyter/redux/actions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ export abstract class JupyterActions extends Actions<JupyterStoreState> {
379379
// Set the input of the given cell in the syncdb, which will also change the store.
380380
// Might throw a CellWriteProtectedException
381381
public set_cell_input(id: string, input: string, save = true): void {
382+
if (!this.store) return;
382383
if (this.store.getIn(["cells", id, "input"]) == input) {
383384
// nothing changed. Note, I tested doing the above check using
384385
// both this.syncdb and this.store, and this.store is orders of magnitude faster.

0 commit comments

Comments
 (0)