2023-07-12 15:50:26 +02:00
|
|
|
<template>
|
2023-12-23 07:56:34 +01:00
|
|
|
<button class="btn btn-primary inline-block mb-4" @click="click()">
|
2023-07-12 15:50:26 +02:00
|
|
|
{{ 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>
|