From c9cefc4a31145cf0b31256c6283f37b45440e551 Mon Sep 17 00:00:00 2001 From: Quentin Guillemin Date: Fri, 2 Jun 2023 12:58:34 +0200 Subject: [PATCH] fix: save and export when nexcloud isn't configured or well configured insted of showing choice modal --- client/src/components/Editor.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/client/src/components/Editor.tsx b/client/src/components/Editor.tsx index 53881f5..daeac2b 100644 --- a/client/src/components/Editor.tsx +++ b/client/src/components/Editor.tsx @@ -70,8 +70,9 @@ function Editor({ userApi ); - language = language || "en"; - readOnly = readOnly || false; + language = language ?? "en"; + readOnly = readOnly ?? false; + const isNextcloudConfigured = nextcloudUrl && userApi; const [room, setRoom] = useState(roomId); const [joinRoom, setJoinRoom] = useState(undefined); @@ -80,6 +81,10 @@ function Editor({ const [nextcloudModal, setNextcloudModal] = useState(undefined); const handleSave = (app: TldrawApp) => { + if (!isNextcloudConfigured) { + onSaveProject(app); + return; + } if (nextcloudModal) return; setNextcloudModal( { + if (!isNextcloudConfigured) { + donwloadImageFile(app, info); + return; + } if (nextcloudModal) return; setNextcloudModal(