mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
25 lines
878 B
JavaScript
25 lines
878 B
JavaScript
import protectedSessionHolder from "../../services/protected_session_holder.js";
|
|
import CommandButtonWidget from "./command_button.js";
|
|
|
|
export default class ProtectedSessionStatusWidget extends CommandButtonWidget {
|
|
constructor() {
|
|
super();
|
|
|
|
this.settings.icon = () => protectedSessionHolder.isProtectedSessionAvailable()
|
|
? "bx-check-shield"
|
|
: "bx-shield-quarter";
|
|
|
|
this.settings.title = () => protectedSessionHolder.isProtectedSessionAvailable()
|
|
? "Protected session is active. Click to leave protected session."
|
|
: "Click to enter protected session";
|
|
|
|
this.settings.command = () => protectedSessionHolder.isProtectedSessionAvailable()
|
|
? "leaveProtectedSession"
|
|
: "enterProtectedSession";
|
|
}
|
|
|
|
protectedSessionStartedEvent() {
|
|
this.refreshIcon();
|
|
}
|
|
}
|