Browse Source

fix: loading state for link

pull/6423/head
DarkPhoenix2704 12 months ago
parent
commit
003bbcff0e
  1. 2
      packages/nc-gui/components/virtual-cell/components/ListItem.vue
  2. 5
      packages/nc-gui/composables/useLTARStore.ts

2
packages/nc-gui/components/virtual-cell/components/ListItem.vue

@ -72,7 +72,7 @@ const attachments: Attachment[] = computed(() => {
<div class="flex flex-col m-[.75rem] gap-1 flex-grow justify-center">
<div class="flex justify-between">
<span class="font-semibold text-gray-800 nc-display-value"> {{ row[relatedTableDisplayValueProp] }} </span>
<div v-if="isLinked" class="text-brand-500 text-0.875">
<div v-if="isLinked && !isLoading" class="text-brand-500 text-0.875">
<LinkIcon
:class="{
'!group-hover:mr-8': fields.length === 0,

5
packages/nc-gui/composables/useLTARStore.ts

@ -218,6 +218,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) {
message.error(`${t('msg.error.failedToLoadList')}: ${await extractSdkResponseErrorMsg(e)}`)
} finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => {
isChildrenExcludedLoading.value = false
}, 600)
@ -273,6 +274,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) {
message.error(`${t('msg.error.failedToLoadChildrenList')}: ${await extractSdkResponseErrorMsg(e)}`)
} finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => {
isChildrenLoading.value = false
}, 600)
@ -371,6 +373,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) {
message.error(`${t('msg.error.unlinkFailed')}: ${await extractSdkResponseErrorMsg(e)}`)
} finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => {
isChildrenExcludedListLoading.value[index] = false
isChildrenListLoading.value[index] = false
@ -438,6 +441,8 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) {
message.error(`Linking failed: ${await extractSdkResponseErrorMsg(e)}`)
} finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => {
isChildrenExcludedListLoading.value[index] = false
isChildrenListLoading.value[index] = false

Loading…
Cancel
Save