Skip to content

Commit

Permalink
fix: store won't initialize correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ludchieng committed Jan 24, 2023
1 parent 7f758ff commit f34b25b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/localstore/synchronizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export const lastUpdatedAt = () => {

export const synchronize = async () => {
const lines = await synchronizeFile('/schemas/lines.json', 'lines')

for (const line of Object.values(lines) as any[]) {
synchronizeLine(line.slugName)
}
localStorage.setItem('lines.updatedAt', new Date().toISOString())
return Promise.all(
Object.values(lines).map((line: any) => synchronizeLine(line.slugName)),
).then(() => {
localStorage.setItem('lines.updatedAt', new Date().toISOString())
})
}

export const synchronizeLine = async (line: string) => {
Expand Down

0 comments on commit f34b25b

Please sign in to comment.