Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: shared view page not found content render issue

Ramesh Maned788f8d536a3
diff --git a/packages/nc-gui/composables/useSharedView.ts b/packages/nc-gui/composables/useSharedView.ts
index 0a10837774..c16996f5f4 100644
--- a/packages/nc-gui/composables/useSharedView.ts
+++ b/packages/nc-gui/composables/useSharedView.ts
@@ -454,6 +454,10 @@ export function useSharedView() {
}
const triggerNotFound = () => {
+ const isNcNotFoundQueryExists = router.currentRoute.value.query.ncNotFound === 'true'
+
+ if (isNcNotFoundQueryExists) return
+
const currentQuery = { ...router.currentRoute.value.query, ncNotFound: 'true' }
router.push({
diff --git a/packages/nc-gui/pages/index/[typeOrId]/calendar/[viewId]/index.vue b/packages/nc-gui/pages/index/[typeOrId]/calendar/[viewId]/index.vue
index a02ae95787..a20a47a4ca 100644
--- a/packages/nc-gui/pages/index/[typeOrId]/calendar/[viewId]/index.vue
+++ b/packages/nc-gui/pages/index/[typeOrId]/calendar/[viewId]/index.vue
@@ -15,17 +15,25 @@ const { loadSharedView, triggerNotFound } = useSharedView()
const showPassword = ref(false)
+const showPageNotFound = ref(false)
+
try {
await loadSharedView(route.params.viewId as string)
} catch (e: any) {
if (e?.response?.status === 403) {
showPassword.value = true
} else if (e?.response?.status === 404) {
- triggerNotFound()
+ showPageNotFound.value = true
} else {
message.error(await extractSdkResponseErrorMsg(e))
}
}
+
+onMounted(() => {
+ if (!showPageNotFound.value) return
+
+ triggerNotFound()
+})
</script>
<template>
diff --git a/packages/nc-gui/pages/index/[typeOrId]/gallery/[viewId]/index.vue b/packages/nc-gui/pages/index/[typeOrId]/gallery/[viewId]/index.vue
index fd0a5791f2..9019db865b 100644
--- a/packages/nc-gui/pages/index/[typeOrId]/gallery/[viewId]/index.vue
+++ b/packages/nc-gui/pages/index/[typeOrId]/gallery/[viewId]/index.vue
@@ -14,17 +14,25 @@ const { loadSharedView, triggerNotFound } = useSharedView()
const showPassword = ref(false)
+const showPageNotFound = ref(false)
+
try {
await loadSharedView(route.params.viewId as string)
} catch (e: any) {
if (e?.response?.status === 403) {
showPassword.value = true
} else if (e?.response?.status === 404) {
- triggerNotFound()
+ showPageNotFound.value = true
} else {
message.error(await extractSdkResponseErrorMsg(e))
}
}
+
+onMounted(() => {
+ if (!showPageNotFound.value) return
+
+ triggerNotFound()
+})
</script>
<template>
diff --git a/packages/nc-gui/pages/index/[typeOrId]/kanban/[viewId]/index.vue b/packages/nc-gui/pages/index/[typeOrId]/kanban/[viewId]/index.vue
index f6d8328f82..08116ab846 100644
--- a/packages/nc-gui/pages/index/[typeOrId]/kanban/[viewId]/index.vue
+++ b/packages/nc-gui/pages/index/[typeOrId]/kanban/[viewId]/index.vue
@@ -15,17 +15,25 @@ const { loadSharedView, triggerNotFound } = useSharedView()
const showPassword = ref(false)
+const showPageNotFound = ref(false)
+
try {
await loadSharedView(route.params.viewId as string)
} catch (e: any) {
if (e?.response?.status === 403) {
showPassword.value = true
} else if (e?.response?.status === 404) {
- triggerNotFound()
+ showPageNotFound.value = true
} else {
message.error(await extractSdkResponseErrorMsg(e))
}
}
+
+onMounted(() => {
+ if (!showPageNotFound.value) return
+
+ triggerNotFound()
+})
</script>
<template>
diff --git a/packages/nc-gui/pages/index/[typeOrId]/map/[viewId]/index.vue b/packages/nc-gui/pages/index/[typeOrId]/map/[viewId]/index.vue
index 971e5390dc..351b4721ce 100644
--- a/packages/nc-gui/pages/index/[typeOrId]/map/[viewId]/index.vue
+++ b/packages/nc-gui/pages/index/[typeOrId]/map/[viewId]/index.vue
@@ -14,17 +14,25 @@ const { loadSharedView, triggerNotFound } = useSharedView()
const showPassword = ref(false)
+const showPageNotFound = ref(false)
+
try {
await loadSharedView(route.params.viewId as string)
} catch (e: any) {
if (e?.response?.status === 403) {
showPassword.value = true
} else if (e?.response?.status === 404) {
- triggerNotFound()
+ showPageNotFound.value = true
} else {
message.error(await extractSdkResponseErrorMsg(e))
}
}
+
+onMounted(() => {
+ if (!showPageNotFound.value) return
+
+ triggerNotFound()
+})
</script>
<template>