Files
hoppscotch/layouts/default.vue
Andrew Bastin 5fce1118f6 Revamp of the Settings State System along with TypeScript support (#1560)
* Add vue-rx, rxjs and lodash as dependencies

* Added vue-rx plugin integration to nuxt config

* Initial settings store implementation

* Add babel plugin for private class properties to for Jest

* Add DispatchingStore test spec

* Initial settings code

* Reactive Streams for fb current user and id token

* Fix typo

* Migrate index and graphql pages to the new store

* Migrate network strategy to the new store

* Fixed Section.vue errors

* Fix getSettingSubject issue

* Migrate fb settings reference in components to the new state system

* Add typings for lodash as dev dependency

* Load setting

* Load initial sync setting values

* Update proxy url

* Add typescript support

* Rewrite Settings store to TypeScript

* Port Settings page to TypeScript as reference

* Move all store migrations to a separate file

* Delete test file for fb.js

* Add ts-jest as dev dependency

* Remove firebase-mock as dependency

* Remove FRAME_COLORS_ENABLED settings value
2021-03-23 11:18:14 -04:00

69 lines
1.7 KiB
Vue

<template>
<div class="wrapper">
<div class="content">
<div class="columns">
<AppSidenav />
<main class="container">
<AppHeader />
<nuxt />
<AppFooter />
</main>
</div>
</div>
</div>
</template>
<script>
import { setupLocalPersistence } from "~/newstore/localpersistence"
import { performMigrations } from "~/helpers/migrations"
export default {
beforeMount() {
let color = localStorage.getItem("THEME_COLOR") || "green"
document.documentElement.setAttribute("data-accent", color)
},
async mounted() {
if (process.client) {
document.body.classList.add("afterLoad")
}
performMigrations()
console.log(
"%cWe ❤︎ open source!",
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
)
console.log(
"%cContribute: https://github.com/hoppscotch/hoppscotch",
"background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;"
)
const workbox = await window.$workbox
if (workbox) {
workbox.addEventListener("installed", (event) => {
if (event.isUpdate) {
this.$toast.show(this.$t("new_version_found"), {
icon: "info",
duration: 0,
theme: "toasted-primary",
action: [
{
text: this.$t("reload"),
onClick: (e, toastObject) => {
toastObject.goAway(0)
this.$router.push("/", () => window.location.reload())
},
},
],
})
}
})
}
setupLocalPersistence()
},
beforeDestroy() {
document.removeEventListener("keydown", this._keyListener)
},
}
</script>