mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Clear library storage version when resetting file sync history
Fixes #1753
This commit is contained in:
parent
f3d274afeb
commit
404fc41b88
2 changed files with 9 additions and 3 deletions
|
|
@ -291,10 +291,12 @@ Zotero.Library.prototype._set = function(prop, val) {
|
|||
if (newVal != val) {
|
||||
throw new Error(`${prop} must be an integer (${typeof val} '${val}' given)`);
|
||||
}
|
||||
// Ensure that it is never decreasing, unless it is being set to -1
|
||||
// by Reset File Sync History
|
||||
if (val != -1 && val < this._libraryStorageVersion) {
|
||||
throw new Error(prop + ' cannot decrease');
|
||||
}
|
||||
val = newVal;
|
||||
|
||||
// Ensure that it is never decreasing
|
||||
if (val < this._libraryStorageVersion) throw new Error(prop + ' cannot decrease');
|
||||
break;
|
||||
|
||||
case '_libraryLastSync':
|
||||
|
|
|
|||
|
|
@ -550,6 +550,10 @@ Zotero.Sync.Storage.Local = {
|
|||
}
|
||||
sql = "UPDATE itemAttachments SET syncState=? WHERE itemID IN (" + sql + ")";
|
||||
await Zotero.DB.queryAsync(sql, [this.SYNC_STATE_TO_UPLOAD].concat(params));
|
||||
|
||||
var library = Zotero.Libraries.get(libraryID);
|
||||
library.storageVersion = -1;
|
||||
await library.save();
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue