Skip to content

Commit

Permalink
fix image edit upload
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Mar 4, 2024
1 parent 12c9dbc commit 9ee044d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
4 changes: 2 additions & 2 deletions src/annotations/components/AnnotationEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ export interface AnnotationProps {
getRootElement: () => HTMLElement
toggleAutoAdd: () => void
isAutoAddEnabled?: boolean
bulkSelectAnnotation: () => void
isBulkSelected: boolean
bulkSelectAnnotation?: () => void
isBulkSelected?: boolean
}

export interface AnnotationEditableEventProps {
Expand Down
19 changes: 11 additions & 8 deletions src/dashboard-refactor/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3317,6 +3317,13 @@ export class DashboardLogic extends UILogic<State, Events> {
]
: []

const bodyToSave = await processCommentForImageUpload(
editNoteForm.bodyInputValue ?? existing.highlight,
)
const commentToSave = await processCommentForImageUpload(
editNoteForm.inputValue ?? existing.comment,
)

this.emitMutation({
searchResults: {
noteData: {
Expand All @@ -3327,14 +3334,10 @@ export class DashboardLogic extends UILogic<State, Events> {
tags: { $set: editNoteForm.tags },
isShared: { $set: event.shouldShare },
comment: {
$set:
editNoteForm.inputValue ??
existing.comment,
$set: commentToSave,
},
highlight: {
$set:
editNoteForm.bodyInputValue ??
existing.highlight,
$set: bodyToSave,
},
isBulkShareProtected: {
$set:
Expand All @@ -3358,9 +3361,9 @@ export class DashboardLogic extends UILogic<State, Events> {
await updateAnnotation({
annotationData: {
localId: event.noteId,
comment: editNoteForm.inputValue ?? existing.comment,
comment: commentToSave,
color: event.color ?? existing.color,
body: editNoteForm.bodyInputValue ?? existing.highlight,
body: bodyToSave,
},
shareOpts: {
shouldShare: event.shouldShare,
Expand Down

0 comments on commit 9ee044d

Please sign in to comment.