Fix localStorage usage

This commit is contained in:
Andrew Bastin
2021-06-21 00:27:45 -04:00
parent 257e2db651
commit f4f29b8520
10 changed files with 81 additions and 38 deletions

View File

@@ -39,10 +39,12 @@
</template>
<script>
import { getLocalConfig, setLocalConfig } from "~/newstore/localpersistence"
export default {
data() {
return {
active: localStorage.getItem("THEME_COLOR") || "green",
active: getLocalConfig("THEME_COLOR") || "green",
accentColors: [
"blue",
"green",
@@ -58,7 +60,7 @@ export default {
},
watch: {
active(color) {
localStorage.setItem("THEME_COLOR", color)
setLocalConfig("THEME_COLOR", color)
},
},