Skip to content

Commit edf5234

Browse files
author
Robin Jullian
committed
synchronization problem theoretically fix
1 parent 124c1ab commit edf5234

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/modules/files.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ const files = {
4646
return bookmarksDb.get('bookmarks').value()
4747
},
4848

49+
set (bookmarks) {
50+
bookmarksDb.get('bookmarks').set(bookmarks).write()
51+
},
52+
4953
push (payload) {
5054
bookmarksDb.get('bookmarks').push(payload).write()
5155
},

app/modules/sync.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const sync = {
2424
}).then((data) => {
2525
if (data.message === 'success') {
2626
resolve(data.bookmarks)
27+
files.bookmarks.set(data.bookmarks)
2728
} else if (data.message === 'TOKEN_ERROR' || data.message === 'USER_NOT_FOUND') {
2829
reject()
2930
} else {

0 commit comments

Comments
 (0)