Browse Source

refactor: move firebase initialization to a plugin

Andrew Bastin 3 years ago
parent
commit
69a6207a4d

+ 0 - 2
packages/hoppscotch-app/layouts/default.vue

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

+ 1 - 0
packages/hoppscotch-app/nuxt.config.js

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

+ 3 - 0
packages/hoppscotch-app/plugins/init-fb.ts

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