Skip to content

Commit

Permalink
fix(preferences): normalize saver
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed May 14, 2023
1 parent a959802 commit 0e8aefb
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script setup lang="ts">
import { useAbsoluteStore } from '@/store/absolute'
import { useLocalStorage } from '@/use/storage/local'
import { useStorage } from '@/use/storage/storage'
import { useElementHover } from '@vueuse/core'
import { ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
Expand All @@ -21,16 +22,20 @@
const local = useLocalStorage()
const { t } = useI18n()
const header = ref()
const storage = useStorage()
const isHovered = useElementHover(header)
const emit = defineEmits(['hover'])
watch(isHovered, (v) => {
emit('hover', v)
})
const onClose = () => {
const onClose = async () => {
if (confirm(t('editor.preferences.header.close'))) {
local.onSaveProject(false).finally(() => window.location.reload())
await storage.normalize()
await local.onSaveProject(false)
window.location.reload()
return
}
Expand Down

0 comments on commit 0e8aefb

Please sign in to comment.