Skip to content

Commit 25ebf8a

Browse files
committed
Up: getSettings
1 parent d9ec773 commit 25ebf8a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/contexts/settings.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ export const homeSections = [
179179
]
180180

181181
export const getSettings = async () => {
182-
const config = await AsyncStorage.getItem('settings')
183-
if (config === null) return defaultSettings
182+
const rawSettings = await AsyncStorage.getItem('settings')
183+
if (rawSettings === null) return defaultSettings
184184
try {
185-
const data = JSON.parse(config)
185+
const data = JSON.parse(rawSettings)
186186
if (data.homeOrderV2 && data?.homeOrderV2?.length !== defaultSettings.homeOrderV2.length) {
187187
defaultSettings.homeOrderV2.forEach((section) => {
188188
if (!data.homeOrderV2.some((s) => s.id === section.id)) {
@@ -193,6 +193,7 @@ export const getSettings = async () => {
193193
return {
194194
...defaultSettings,
195195
...data,
196+
homeOrder: undefined,
196197
}
197198
} catch {
198199
return defaultSettings

0 commit comments

Comments
 (0)