forked from FoundKeyGang/FoundKey
fix onBeforeRouteLeave
fixes https://github.com/misskey-dev/misskey/issues/8861
This commit is contained in:
parent
c781dd445f
commit
252ab3d852
2 changed files with 72 additions and 68 deletions
|
@ -1,4 +1,5 @@
|
|||
<template><MkStickyContainer>
|
||||
<template>
|
||||
<MkStickyContainer>
|
||||
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
||||
<MkSpacer :content-max="800" :margin-min="16" :margin-max="32">
|
||||
<div class="cwepdizn _formRoot">
|
||||
|
@ -62,7 +63,8 @@
|
|||
</div>
|
||||
</FormFolder>
|
||||
</div>
|
||||
</MkSpacer></MkStickyContainer>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -85,6 +87,7 @@ import { ColdDeviceStorage, defaultStore } from '@/store';
|
|||
import { addTheme } from '@/theme-store';
|
||||
import { i18n } from '@/i18n';
|
||||
import { useLeaveGuard } from '@/scripts/use-leave-guard';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
|
||||
const bgColors = [
|
||||
{ color: '#f5f5f5', kind: 'light', forPreview: '#f5f5f5' },
|
||||
|
@ -204,7 +207,17 @@ async function saveAs() {
|
|||
|
||||
watch($$(theme), apply, { deep: true });
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
const headerActions = $computed(() => [{
|
||||
asFullButton: true,
|
||||
icon: 'fas fa-eye',
|
||||
text: i18n.ts.preview,
|
||||
handler: showPreview,
|
||||
}, {
|
||||
asFullButton: true,
|
||||
icon: 'fas fa-check',
|
||||
text: i18n.ts.saveAs,
|
||||
handler: saveAs,
|
||||
}]);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
||||
|
@ -212,17 +225,6 @@ definePageMetadata({
|
|||
title: i18n.ts.themeEditor,
|
||||
icon: 'fas fa-palette',
|
||||
bg: 'var(--bg)',
|
||||
actions: [{
|
||||
asFullButton: true,
|
||||
icon: 'fas fa-eye',
|
||||
text: i18n.ts.preview,
|
||||
handler: showPreview,
|
||||
}, {
|
||||
asFullButton: true,
|
||||
icon: 'fas fa-check',
|
||||
text: i18n.ts.saveAs,
|
||||
handler: saveAs,
|
||||
}],
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import { i18n } from '@/i18n';
|
|||
import * as os from '@/os';
|
||||
|
||||
export function useLeaveGuard(enabled: Ref<boolean>) {
|
||||
/* TODO
|
||||
const setLeaveGuard = inject('setLeaveGuard');
|
||||
|
||||
if (setLeaveGuard) {
|
||||
|
@ -28,6 +29,7 @@ export function useLeaveGuard(enabled: Ref<boolean>) {
|
|||
return !canceled;
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
function onBeforeLeave(ev: BeforeUnloadEvent) {
|
||||
|
|
Loading…
Reference in a new issue