mirror of
https://github.com/zadam/trilium.git
synced 2025-12-12 02:14:25 +01:00
28 lines
938 B
JavaScript
28 lines
938 B
JavaScript
import { t } from "../../services/i18n.js";
|
|
import protectedSessionHolder from "../../services/protected_session_holder.js";
|
|
import CommandButtonWidget from "./command_button.js";
|
|
|
|
export default class ProtectedSessionStatusWidget extends CommandButtonWidget {
|
|
constructor() {
|
|
super();
|
|
|
|
this.class("launcher-button");
|
|
|
|
this.settings.icon = () => protectedSessionHolder.isProtectedSessionAvailable()
|
|
? "bx-check-shield"
|
|
: "bx-shield-quarter";
|
|
|
|
this.settings.title = () => protectedSessionHolder.isProtectedSessionAvailable()
|
|
? t("protected_session_status.active")
|
|
: t("protected_session_status.inactive");
|
|
|
|
this.settings.command = () => protectedSessionHolder.isProtectedSessionAvailable()
|
|
? "leaveProtectedSession"
|
|
: "enterProtectedSession";
|
|
}
|
|
|
|
protectedSessionStartedEvent() {
|
|
this.refreshIcon();
|
|
}
|
|
}
|