Skip to content

Commit

Permalink
synchronization problem theoretically fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Jullian committed Dec 22, 2018
1 parent 124c1ab commit edf5234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/modules/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const files = {
return bookmarksDb.get('bookmarks').value()
},

set (bookmarks) {
bookmarksDb.get('bookmarks').set(bookmarks).write()
},

push (payload) {
bookmarksDb.get('bookmarks').push(payload).write()
},
Expand Down
1 change: 1 addition & 0 deletions app/modules/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const sync = {
}).then((data) => {
if (data.message === 'success') {
resolve(data.bookmarks)
files.bookmarks.set(data.bookmarks)
} else if (data.message === 'TOKEN_ERROR' || data.message === 'USER_NOT_FOUND') {
reject()
} else {
Expand Down

0 comments on commit edf5234

Please sign in to comment.