diff --git a/packages/nc-gui/components/smartsheet/Row.vue b/packages/nc-gui/components/smartsheet/Row.vue index 9950f567b8..6854dd7081 100644 --- a/packages/nc-gui/components/smartsheet/Row.vue +++ b/packages/nc-gui/components/smartsheet/Row.vue @@ -35,11 +35,11 @@ watch(isNew, async (nextVal, prevVal) => { const reloadViewDataTrigger = inject(ReloadViewDataHookInj)! // override reload trigger and use it to reload row -const reloadHook = createEventHook() +const reloadHook = createEventHook() -reloadHook.on(() => { +reloadHook.on((shouldShowLoading) => { if (isNew.value) return - reloadViewDataTrigger?.trigger() + reloadViewDataTrigger?.trigger(shouldShowLoading) }) provide(ReloadRowDataHookInj, reloadHook) diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index 56c2472dd2..3dbb20469f 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -104,7 +104,7 @@ const reloadParentRowHook = inject(ReloadRowDataHookInj, createEventHook()) const reloadHook = createEventHook() reloadHook.on(() => { - reloadParentRowHook?.trigger() + reloadParentRowHook?.trigger(false) if (isNew.value) return loadRow() }) diff --git a/packages/nc-gui/composables/useLTARStore.ts b/packages/nc-gui/composables/useLTARStore.ts index 7feb9e85f5..3e7ad5a304 100644 --- a/packages/nc-gui/composables/useLTARStore.ts +++ b/packages/nc-gui/composables/useLTARStore.ts @@ -28,7 +28,12 @@ interface DataApiResponse { /** Store for managing Link to another cells */ const [useProvideLTARStore, useLTARStore] = useInjectionState( - (column: Ref>, row: Ref, isNewRow: ComputedRef | Ref, reloadData = () => {}) => { + ( + column: Ref>, + row: Ref, + isNewRow: ComputedRef | Ref, + reloadData = (_showProgress?: boolean) => {}, + ) => { // state const { metas, getMeta } = useMetas() @@ -221,7 +226,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( return false } - reloadData?.() + reloadData?.(false) /** reload child list if not a new row */ if (!isNewRow?.value) { @@ -264,7 +269,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( message.error(`${t('msg.error.unlinkFailed')}: ${await extractSdkResponseErrorMsg(e)}`) } - reloadData?.() + reloadData?.(false) } const link = async (row: Record) => { @@ -296,7 +301,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( message.error(`Linking failed: ${await extractSdkResponseErrorMsg(e)}`) } - reloadData?.() + reloadData?.(false) } // watchers diff --git a/packages/nc-gui/context/index.ts b/packages/nc-gui/context/index.ts index 5127e6d325..339c17006e 100644 --- a/packages/nc-gui/context/index.ts +++ b/packages/nc-gui/context/index.ts @@ -24,7 +24,7 @@ export const ReadonlyInj: InjectionKey = Symbol('readonly-injection') /** when bool is passed, it indicates if a loading spinner should be visible while reloading */ export const ReloadViewDataHookInj: InjectionKey> = Symbol('reload-view-data-injection') export const ReloadViewMetaHookInj: InjectionKey> = Symbol('reload-view-meta-injection') -export const ReloadRowDataHookInj: InjectionKey> = Symbol('reload-row-data-injection') +export const ReloadRowDataHookInj: InjectionKey> = Symbol('reload-row-data-injection') export const OpenNewRecordFormHookInj: InjectionKey> = Symbol('open-new-record-form-injection') export const FieldsInj: InjectionKey> = Symbol('fields-injection') export const ViewListInj: InjectionKey> = Symbol('view-list-injection')