diff --git a/frontend/src/components/complex-table/index.vue b/frontend/src/components/complex-table/index.vue index b4372b680..3579e2854 100644 --- a/frontend/src/components/complex-table/index.vue +++ b/frontend/src/components/complex-table/index.vue @@ -213,13 +213,7 @@ const responsivePaginationLayout = computed(() => { }); const responsivePagerCount = computed(() => { - if (mobile.value || props.paginationConfig?.small) { - return 5; - } - if (paginationWidth.value < 520) { - return 3; - } - if (paginationWidth.value < 720) { + if (mobile.value || props.paginationConfig?.small || paginationWidth.value < 720) { return 5; } return 7; diff --git a/frontend/src/global/use-theme.ts b/frontend/src/global/use-theme.ts index 541664e4d..e072eb9a2 100644 --- a/frontend/src/global/use-theme.ts +++ b/frontend/src/global/use-theme.ts @@ -1,4 +1,4 @@ -import { onUnmounted } from 'vue'; +import { getCurrentScope, onScopeDispose } from 'vue'; import { GlobalStore } from '@/store'; import { setPrimaryColor } from '@/utils/theme'; @@ -27,7 +27,6 @@ export const useTheme = () => { } }; - // Listen for OS theme changes when theme is set to "auto" const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); const onSystemThemeChange = () => { const globalStore = GlobalStore(); @@ -36,9 +35,11 @@ export const useTheme = () => { } }; mediaQuery.addEventListener('change', onSystemThemeChange); - onUnmounted(() => { - mediaQuery.removeEventListener('change', onSystemThemeChange); - }); + if (getCurrentScope()) { + onScopeDispose(() => { + mediaQuery.removeEventListener('change', onSystemThemeChange); + }); + } return { switchTheme, diff --git a/frontend/src/views/host/file-management/code-editor/history/index.vue b/frontend/src/views/host/file-management/code-editor/history/index.vue index b78f41145..917a22c35 100644 --- a/frontend/src/views/host/file-management/code-editor/history/index.vue +++ b/frontend/src/views/host/file-management/code-editor/history/index.vue @@ -102,7 +102,7 @@