refactor: move firebase initialization to a plugin

This commit is contained in:
Andrew Bastin
2021-11-04 18:33:21 +05:30
parent 9e74a8c2e7
commit 69a6207a4d
3 changed files with 4 additions and 2 deletions

View File

@@ -52,7 +52,6 @@ import { setupLocalPersistence } from "~/newstore/localpersistence"
import { performMigrations } from "~/helpers/migrations" import { performMigrations } from "~/helpers/migrations"
import { initUserInfo } from "~/helpers/teams/BackendUserInfo" import { initUserInfo } from "~/helpers/teams/BackendUserInfo"
import { registerApolloAuthUpdate } from "~/helpers/apollo" import { registerApolloAuthUpdate } from "~/helpers/apollo"
import { initializeFirebase } from "~/helpers/fb"
import { useSetting } from "~/newstore/settings" import { useSetting } from "~/newstore/settings"
import { logPageView } from "~/helpers/fb/analytics" import { logPageView } from "~/helpers/fb/analytics"
import { hookKeybindingsListener } from "~/helpers/keybindings" import { hookKeybindingsListener } from "~/helpers/keybindings"
@@ -189,7 +188,6 @@ export default defineComponent({
}) })
} }
initializeFirebase()
initUserInfo() initUserInfo()
logPageView(this.$router.currentRoute.fullPath) logPageView(this.$router.currentRoute.fullPath)

View File

@@ -100,6 +100,7 @@ export default {
"~/plugins/v-focus", "~/plugins/v-focus",
"~/plugins/v-textarea", "~/plugins/v-textarea",
"~/plugins/vue-apollo", "~/plugins/vue-apollo",
"~/plugins/init-fb.ts",
"~/plugins/crisp", "~/plugins/crisp",
{ src: "~/plugins/web-worker", ssr: false }, { src: "~/plugins/web-worker", ssr: false },
], ],

View File

@@ -0,0 +1,3 @@
import { initializeFirebase } from "~/helpers/fb"
initializeFirebase()