Skip to content

Commit 94901d8

Browse files
committed
Overtake canonical URLs from server
fixes #78
1 parent 3d3f9f0 commit 94901d8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib/Account.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ export default class Account {
134134
let serverList = (await this.server.pullBookmarks())
135135
.filter(bm => serverRoot ? bm.path.indexOf(serverRoot) === 0 : true)
136136

137+
mappings = await this.storage.getMappings()
138+
await this.tree.load(mappings)
139+
137140
// deletes everything locally that is not new but doesn't exist on the server anymore
138141
await this.sync_deleteFromTree(serverList)
139142
// Goes through server's list and updates creates things locally as needed
@@ -188,9 +191,9 @@ export default class Account {
188191
// ignore this bookmark as it's not supported by the server
189192
return
190193
}
191-
serverMark.localId = bookmark.localId
192-
await this.storage.addToMappings(serverMark)
193-
await this.storage.addToCache(serverMark.localId, await serverMark.hash())
194+
bookmark.id = serverMark.id
195+
await this.storage.addToMappings(bookmark)
196+
await this.storage.addToCache(bookmark.localId, await bookmark.hash())
194197
},
195198
BATCH_SIZE
196199
)

0 commit comments

Comments
 (0)