Remove redudant applySettingFB

This commit is contained in:
Andrew Bastin
2021-06-16 22:33:17 -04:00
parent 0cedc9ed51
commit 4ce7f0b487
2 changed files with 3 additions and 36 deletions

View File

@@ -1,10 +1,6 @@
import firebase from "firebase"
import { currentUser$ } from "./auth"
import {
applySettingFB,
settingsStore,
SettingsType,
} from "~/newstore/settings"
import { applySetting, settingsStore, SettingsType } from "~/newstore/settings"
/**
* Used locally to prevent infinite loop when settings sync update
@@ -51,7 +47,7 @@ export function initSettings() {
Object.keys(dispatch.payload).forEach((key) => {
writeSettings(key, dispatch.payload[key])
})
} else if (dispatch.dispatcher !== "applySettingFB") {
} else {
writeSettings(
dispatch.payload.settingKey,
settingsStore.value[dispatch.payload.settingKey as keyof SettingsType]
@@ -86,7 +82,7 @@ export function initSettings() {
loadedSettings = false
settings.forEach((e) => {
if (e && e.name && e.value != null) {
applySettingFB(e.name, e.value)
applySetting(e.name, e.value)
}
})
loadedSettings = true