refactor: move from network strategies to generic interceptor service (#3242)
This commit is contained in:
@@ -5,6 +5,9 @@ import { def as collectionsDef } from "./platform/collections/collections.platfo
|
||||
import { def as settingsDef } from "./platform/settings/settings.platform"
|
||||
import { def as historyDef } from "./platform/history/history.platform"
|
||||
import { def as tabStateDef } from "./platform/tabState/tabState.platform"
|
||||
import { browserInterceptor } from "@hoppscotch/common/platform/std/interceptors/browser"
|
||||
import { proxyInterceptor } from "@hoppscotch/common/platform/std/interceptors/proxy"
|
||||
import { ExtensionInterceptorService } from "@hoppscotch/common/platform/std/interceptors/extension"
|
||||
|
||||
createHoppApp("#app", {
|
||||
auth: authDef,
|
||||
@@ -15,6 +18,14 @@ createHoppApp("#app", {
|
||||
history: historyDef,
|
||||
tabState: tabStateDef,
|
||||
},
|
||||
interceptors: {
|
||||
default: "browser",
|
||||
interceptors: [
|
||||
{ type: "standalone", interceptor: browserInterceptor },
|
||||
{ type: "standalone", interceptor: proxyInterceptor },
|
||||
{ type: "service", service: ExtensionInterceptorService },
|
||||
],
|
||||
},
|
||||
platformFeatureFlags: {
|
||||
exportAsGIST: false,
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as E from "fp-ts/Either"
|
||||
import { runGQLSubscription } from "@hoppscotch/common/helpers/backend/GQLClient"
|
||||
import {
|
||||
bulkApplySettings,
|
||||
defaultSettings,
|
||||
getDefaultSettings,
|
||||
} from "@hoppscotch/common/newstore/settings"
|
||||
import { runDispatchWithOutSyncing } from "@lib/sync"
|
||||
|
||||
@@ -47,7 +47,7 @@ async function loadUserSettings() {
|
||||
// create user settings if it doesn't exist
|
||||
E.isLeft(res) &&
|
||||
res.left.error == "user_settings/not_found" &&
|
||||
(await createUserSettings(JSON.stringify(defaultSettings)))
|
||||
(await createUserSettings(JSON.stringify(getDefaultSettings())))
|
||||
|
||||
if (E.isRight(res)) {
|
||||
runDispatchWithOutSyncing(() => {
|
||||
|
||||
Reference in New Issue
Block a user