diff --git a/resources/js/pages/layout/architectural-background.js b/resources/js/pages/layout/architectural-background.js index 2af16f02e53..c41ec9263bf 100644 --- a/resources/js/pages/layout/architectural-background.js +++ b/resources/js/pages/layout/architectural-background.js @@ -1,4 +1,4 @@ -import { nextTick, onMounted, onUnmounted } from 'vue'; +import { getCurrentInstance, nextTick, onMounted, onUnmounted } from 'vue'; const className = 'bg-architectural-lines'; const id = 'content-card'; @@ -18,5 +18,8 @@ export default function useArchitecturalBackground() { export function toggleArchitecturalBackground(enable) { enable ? add() : remove(); - onUnmounted(() => remove()); + + if (getCurrentInstance()) { + onUnmounted(() => remove()); + } }