Skip to content

Commit

Permalink
LeaveGuardを削除
Browse files Browse the repository at this point in the history
  • Loading branch information
adzukimame committed Dec 8, 2024
1 parent 8003d1b commit 060a654
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 56 deletions.
7 changes: 1 addition & 6 deletions packages/frontend/src/pages/theme-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ import * as os from '@/os.js';
import { ColdDeviceStorage, defaultStore } from '@/store.js';
import { addTheme } from '@/theme-store.js';
import { i18n } from '@/i18n.js';
import { useLeaveGuard } from '@/scripts/use-leave-guard.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';

const $i = signinRequired();
Expand Down Expand Up @@ -133,9 +132,6 @@ const theme = ref<Pick<Theme, 'base' | 'props'> & Partial<Theme>>({
});
const description = ref<string | null>(null);
const themeCode = ref<string | null>(null);
const changed = ref(false);

useLeaveGuard(changed);

function showPreview() {
os.pageWindow('/preview');
Expand Down Expand Up @@ -170,7 +166,6 @@ function setFgColor(color) {
function apply() {
themeCode.value = JSON5.stringify(theme.value, null, '\t');
applyTheme(theme.value as Theme, false);
changed.value = true;
}

function applyThemeCode() {
Expand Down Expand Up @@ -211,7 +206,7 @@ async function saveAs() {
} else {
ColdDeviceStorage.set('lightTheme', theme.value as Theme);
}
changed.value = false;

os.alert({
type: 'success',
text: i18n.tsx._theme.installed({ name: theme.value.name }),
Expand Down
50 changes: 0 additions & 50 deletions packages/frontend/src/scripts/use-leave-guard.ts

This file was deleted.

0 comments on commit 060a654

Please sign in to comment.