From b665dd6b05af1b213b36b9c5c6ee9d14c53d54f0 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 6 Oct 2022 12:23:13 +0200 Subject: [PATCH] fix(nc-gui): use separate form state for password modal --- .../composables/useSharedFormViewStore.ts | 2 +- .../pages/[projectType]/form/[viewId].vue | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/composables/useSharedFormViewStore.ts b/packages/nc-gui/composables/useSharedFormViewStore.ts index 3e220dd844..32052079d1 100644 --- a/packages/nc-gui/composables/useSharedFormViewStore.ts +++ b/packages/nc-gui/composables/useSharedFormViewStore.ts @@ -87,7 +87,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share } else if ((await extractSdkResponseErrorMsg(e)) === ErrorMessages.INVALID_SHARED_VIEW_PASSWORD) { passwordDlg.value = true - if (password.value) passwordError.value = 'Something went wrong. Please check your credentials.' + if (password.value && password.value !== '') passwordError.value = 'Something went wrong. Please check your credentials.' } } } diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId].vue b/packages/nc-gui/pages/[projectType]/form/[viewId].vue index 937abb9871..90cd2f1027 100644 --- a/packages/nc-gui/pages/[projectType]/form/[viewId].vue +++ b/packages/nc-gui/pages/[projectType]/form/[viewId].vue @@ -7,11 +7,13 @@ import { createEventHook, definePageMeta, provide, + reactive, ref, useProvideSharedFormStore, useProvideSmartsheetStore, useRoute, useSidebar, + watch, } from '#imports' definePageMeta({ @@ -36,6 +38,17 @@ if (!notFound.value) { useProvideSmartsheetStore(sharedView, meta, true) } + +const form = reactive({ + password: '', +}) + +watch( + () => form.password, + () => { + password.value = form.password + }, +)