mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
use lazy title loading in bookmarks buttons to have decrypted title upon protected session start, #2393
This commit is contained in:
parent
1aff42f453
commit
e29aee1aae
@ -44,7 +44,10 @@ export default class ButtonWidget extends NoteContextAwareWidget {
|
|||||||
this.$widget.tooltip({
|
this.$widget.tooltip({
|
||||||
html: true,
|
html: true,
|
||||||
title: () => {
|
title: () => {
|
||||||
const title = this.settings.title;
|
const title = typeof this.settings.title === "function"
|
||||||
|
? this.settings.title()
|
||||||
|
: this.settings.title;
|
||||||
|
|
||||||
const action = actions.find(act => act.actionName === this.settings.command);
|
const action = actions.find(act => act.actionName === this.settings.command);
|
||||||
|
|
||||||
if (action && action.effectiveShortcuts.length > 0) {
|
if (action && action.effectiveShortcuts.length > 0) {
|
||||||
|
@ -18,7 +18,12 @@ export default class OpenNoteButtonWidget extends ButtonWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.icon(note.getIcon());
|
this.icon(note.getIcon());
|
||||||
this.title(note.title);
|
this.title(() => {
|
||||||
|
const n = froca.getNoteFromCache(noteId);
|
||||||
|
|
||||||
|
// always fresh, always decoded (when protected session is available)
|
||||||
|
return n.title;
|
||||||
|
});
|
||||||
|
|
||||||
this.refreshIcon();
|
this.refreshIcon();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user