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

@@ -167,6 +167,7 @@
<script>
import intializePwa from "~/helpers/pwa"
import { currentUser$ } from "~/helpers/fb/auth"
import { getLocalConfig, setLocalConfig } from "~/newstore/localpersistence"
// import { hasExtensionInstalled } from "~/helpers/strategies/ExtensionStrategy"
export default {
@@ -192,7 +193,7 @@ export default {
// Initializes the PWA code - checks if the app is installed,
// etc.
this.showInstallPrompt = await intializePwa()
const cookiesAllowed = localStorage.getItem("cookiesAllowed") === "yes"
const cookiesAllowed = getLocalConfig("cookiesAllowed") === "yes"
if (!cookiesAllowed) {
this.$toast.show(this.$t("we_use_cookies"), {
icon: "info",
@@ -202,7 +203,7 @@ export default {
{
text: this.$t("dismiss"),
onClick: (_, toastObject) => {
localStorage.setItem("cookiesAllowed", "yes")
setLocalConfig("cookiesAllowed", "yes")
toastObject.goAway(0)
},
},