Tag reload note count on download
This commit is contained in:
@@ -472,7 +472,7 @@ class NotesCtrl extends PureCtrl {
|
||||
});
|
||||
}
|
||||
if (note.errorDecrypting) {
|
||||
if (note.waitingForKeys) {
|
||||
if (note.waitingForKey) {
|
||||
flags.push({
|
||||
text: "Waiting For Keys",
|
||||
class: 'info'
|
||||
|
||||
@@ -146,7 +146,6 @@ class RootCtrl extends PureCtrl {
|
||||
updateSyncStatus() {
|
||||
const syncStatus = this.application.getSyncStatus();
|
||||
const stats = syncStatus.getStats();
|
||||
console.log("SN: RootCtrl -> updateSyncStatus -> stats", stats);
|
||||
if (stats.downloadCount > 20) {
|
||||
const text = `Downloading ${stats.downloadCount} items. Keep app open.`;
|
||||
this.syncStatus = this.statusManager.replaceStatusWithString(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SNNote, SNSmartTag, ContentTypes } from 'snjs';
|
||||
import { SNNote, SNSmartTag, ContentTypes, ApplicationEvents } from 'snjs';
|
||||
import template from '%/tags.pug';
|
||||
import { AppStateEvents } from '@/state';
|
||||
import { PANEL_NAME_TAGS } from '@/controllers/constants';
|
||||
@@ -97,6 +97,21 @@ class TagsPanelCtrl extends PureCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** @override */
|
||||
async onAppEvent(eventName) {
|
||||
super.onAppEvent(eventName);
|
||||
if (eventName === ApplicationEvents.LocalDataIncrementalLoad) {
|
||||
this.reloadNoteCounts();
|
||||
} else if (eventName === ApplicationEvents.SyncStatusChanged) {
|
||||
const syncStatus = this.application.getSyncStatus();
|
||||
const stats = syncStatus.getStats();
|
||||
if (stats.downloadCount > 0) {
|
||||
this.reloadNoteCounts();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reloadNoteCounts() {
|
||||
let allTags = [];
|
||||
if (this.state.tags) {
|
||||
|
||||
Reference in New Issue
Block a user