jointrashposs/components/content/AiModeB.vue
kakkokari-gtyih 51d90f2d0c (add) ai mode
2023-07-12 22:50:26 +09:00

27 lines
730 B
Vue

<template>
<button class="btn btn-primary inline-block mb-4" @click="click()">
{{ isEnabledAiChanMode ? '藍モードを無効にする' : '藍モードを有効にする' }}
</button>
</template>
<script setup lang="ts">
const isEnabledAiChanMode = ref<boolean>(false);
if (process.client) {
isEnabledAiChanMode.value = ((localStorage.getItem('miHub_aichan_mode') ?? '') == 'true');
// migration
if (!isEnabledAiChanMode.value) {
isEnabledAiChanMode.value = ((localStorage.getItem('aimode') ?? '') == 'true');
}
}
function click() {
localStorage.setItem('miHub_aichan_mode',isEnabledAiChanMode.value ? 'false' : 'true');
location.reload();
}
</script>
<style scoped>
</style>