Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: move updateImage function to new api

ammarahm-ed397f8b193a60
diff --git a/apps/mobile/src/screens/editor/tiptap/commands.ts b/apps/mobile/src/screens/editor/tiptap/commands.ts
index ad6347a3c..303d7c45c 100644
--- a/apps/mobile/src/screens/editor/tiptap/commands.ts
+++ b/apps/mobile/src/screens/editor/tiptap/commands.ts
@@ -187,8 +187,12 @@ typeof globalThis.statusBar !== "undefined" && statusBar.current.set({date:"",sa
await this.doAsync(`editor && editor.commands.insertImage(${JSON.stringify(image)})`);
};
- updateImage = async (image: ImageAttributes) => {
- await this.doAsync(`editor && editor.commands.updateImage(${JSON.stringify(image)})`);
+ updateImage = async ({ src, hash }: ImageAttributes) => {
+ await this.doAsync(
+ `editor && editor.commands.updateImage(${JSON.stringify({
+ hash
+ })},${JSON.stringify({ src, hash, preventUpdate: true })})`
+ );
};
handleBack = async () => {