1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Desktop: Do not display tags that are not associated with any note

This commit is contained in:
Laurent Cozic
2019-02-13 23:33:07 +00:00
parent a3e74320fa
commit 0469fe76d7
4 changed files with 30 additions and 2 deletions

View File

@ -299,6 +299,7 @@ class BaseApplication {
const result = next(action);
const newState = store.getState();
let refreshNotes = false;
let refreshTags = false;
let refreshNotesUseSelectedNoteId = false;
reduxSharedMiddleware(store, next, action);
@ -336,10 +337,21 @@ class BaseApplication {
refreshNotes = true;
}
if (action.type == 'NOTE_DELETE') {
refreshTags = true;
}
if (refreshNotes) {
await this.refreshNotes(newState, refreshNotesUseSelectedNoteId);
}
if (refreshTags) {
this.dispatch({
type: 'TAG_UPDATE_ALL',
items: await Tag.allWithNotes(),
});
}
if ((action.type == 'SETTING_UPDATE_ONE' && (action.key == 'dateFormat' || action.key == 'timeFormat')) || (action.type == 'SETTING_UPDATE_ALL')) {
time.setDateFormat(Setting.value('dateFormat'));
time.setTimeFormat(Setting.value('timeFormat'));