mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 10:40:41 +01:00
launcher improvements
This commit is contained in:
@@ -1,29 +1,24 @@
|
||||
import ButtonWidget from "./button_widget.js";
|
||||
import protectedSessionHolder from "../../services/protected_session_holder.js";
|
||||
import CommandButtonWidget from "./command_button.js";
|
||||
|
||||
export default class ProtectedSessionStatusWidget extends ButtonWidget {
|
||||
doRender() {
|
||||
this.updateSettings();
|
||||
export default class ProtectedSessionStatusWidget extends CommandButtonWidget {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
super.doRender();
|
||||
}
|
||||
|
||||
updateSettings() {
|
||||
this.settings.icon = protectedSessionHolder.isProtectedSessionAvailable()
|
||||
this.settings.icon = () => protectedSessionHolder.isProtectedSessionAvailable()
|
||||
? "bx-check-shield"
|
||||
: "bx-shield-quarter";
|
||||
|
||||
this.settings.title = protectedSessionHolder.isProtectedSessionAvailable()
|
||||
this.settings.title = () => protectedSessionHolder.isProtectedSessionAvailable()
|
||||
? "Protected session is active. Click to leave protected session."
|
||||
: "Click to enter protected session";
|
||||
|
||||
this.settings.command = protectedSessionHolder.isProtectedSessionAvailable()
|
||||
this.settings.command = () => protectedSessionHolder.isProtectedSessionAvailable()
|
||||
? "leaveProtectedSession"
|
||||
: "enterProtectedSession";
|
||||
}
|
||||
|
||||
protectedSessionStartedEvent() {
|
||||
this.updateSettings();
|
||||
this.refreshIcon();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user