mirror of
https://codeberg.org/valpackett/tiddlypwa.git
synced 2026-03-15 04:10:25 -07:00
Plugin: only overwrite with server change if local tiddler is older
This commit is contained in:
parent
b6abe2aff8
commit
03a4213596
1 changed files with 6 additions and 2 deletions
|
|
@ -464,8 +464,12 @@ Formatted with `deno fmt`.
|
|||
};
|
||||
this.logger.log('remote change', thash);
|
||||
if (changedKeys.has(thash)) {
|
||||
this.logger.log('conflict', thash);
|
||||
// TODO: pick newer between the two, save older under special name, present results
|
||||
const ourtid = txn.objectStore('tiddlers').get(tid.thash);
|
||||
this.logger.log('conflict:', thash, 'server:', tid.mtime, 'local:', ourtid.mtime);
|
||||
if (ourtid.mtime > tid.mtime) {
|
||||
continue;
|
||||
}
|
||||
// TODO: save the older tiddler under a special name and present conflict results
|
||||
}
|
||||
txn.objectStore('tiddlers').put(tid);
|
||||
if (deleted) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue