Better statuses for migrations, beta2
This commit is contained in:
@@ -47,6 +47,10 @@ angular.module('app')
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.syncStatus = statusManager.removeStatus(this.syncStatus);
|
this.syncStatus = statusManager.removeStatus(this.syncStatus);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
} else if(status.total > 20) {
|
||||||
|
this.uploadSyncStatus = statusManager.replaceStatusWithString(this.uploadSyncStatus, `Syncing ${status.current}/${status.total} items...`)
|
||||||
|
} else if(this.uploadSyncStatus) {
|
||||||
|
this.uploadSyncStatus = statusManager.removeStatus(this.uploadSyncStatus);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ class DesktopManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveBackup() {
|
||||||
|
this.majorDataChangeHandler && this.majorDataChangeHandler();
|
||||||
|
}
|
||||||
|
|
||||||
getApplicationDataPath() {
|
getApplicationDataPath() {
|
||||||
console.assert(this.applicationDataPath, "applicationDataPath is null");
|
console.assert(this.applicationDataPath, "applicationDataPath is null");
|
||||||
return this.applicationDataPath;
|
return this.applicationDataPath;
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ class MigrationManager extends SFMigrationManager {
|
|||||||
handler: async (notes) => {
|
handler: async (notes) => {
|
||||||
|
|
||||||
let needsSync = false;
|
let needsSync = false;
|
||||||
let status = this.statusManager.addStatusFromString("Running migration...");
|
let status = this.statusManager.addStatusFromString("Optimizing data...");
|
||||||
|
let dirtyCount = 0;
|
||||||
|
|
||||||
for(let note of notes) {
|
for(let note of notes) {
|
||||||
if(!note.content) {
|
if(!note.content) {
|
||||||
@@ -125,22 +126,31 @@ class MigrationManager extends SFMigrationManager {
|
|||||||
if(tag && !tag.hasRelationshipWithItem(note)) {
|
if(tag && !tag.hasRelationshipWithItem(note)) {
|
||||||
tag.addItemAsRelationship(note);
|
tag.addItemAsRelationship(note);
|
||||||
tag.setDirty(true, true);
|
tag.setDirty(true, true);
|
||||||
needsSync = true;
|
dirtyCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newReferences.length != references.length) {
|
if(newReferences.length != references.length) {
|
||||||
note.content.references = newReferences;
|
note.content.references = newReferences;
|
||||||
note.setDirty(true, true);
|
note.setDirty(true, true);
|
||||||
needsSync = true;
|
dirtyCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(needsSync) {
|
if(dirtyCount > 0) {
|
||||||
|
if(isDesktopApplication()) {
|
||||||
|
this.desktopManager.saveBackup();
|
||||||
|
}
|
||||||
|
|
||||||
|
status = this.statusManager.replaceStatusWithString(status, `${dirtyCount} items optimized.`);
|
||||||
await this.syncManager.sync();
|
await this.syncManager.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.statusManager.removeStatus(status);
|
status = this.statusManager.replaceStatusWithString(status, `Optimization complete.`);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.statusManager.removeStatus(status);
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3692
package-lock.json
generated
3692
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "standard-notes-web",
|
"name": "standard-notes-web",
|
||||||
"version": "3.0.7-beta1",
|
"version": "3.0.7-beta2",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
"serve-static": "^1.13.2",
|
"serve-static": "^1.13.2",
|
||||||
"sn-models": "0.1.14",
|
"sn-models": "0.1.14",
|
||||||
"sn-stylekit": "2.0.13",
|
"sn-stylekit": "2.0.13",
|
||||||
"standard-file-js": "file:~/Desktop/sn/dev/sfjs",
|
"standard-file-js": "0.3.57",
|
||||||
"grunt-shell": "^2.1.0"
|
"grunt-shell": "^2.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user