diff --git a/frontend/src/components/Frame.tsx b/frontend/src/components/Frame.tsx index f3b6c98..d6bbf03 100644 --- a/frontend/src/components/Frame.tsx +++ b/frontend/src/components/Frame.tsx @@ -7,6 +7,7 @@ import { connected, connected_to, secret } from './charger_list'; import { setAppNavigation } from './Navbar'; import { enableLogging } from '../utils'; import Median from "median-js-bridge"; +import i18n from '../i18n'; export const chargerID = signal(0); export const chargerPort = signal(0); @@ -34,6 +35,20 @@ export class Frame extends Component { this.startWorker(); + if (Median.isNativeApp()) { + const t = i18n.t; + Median.sidebar.setItems({ + enabled: true, + persist: true, + items: [ + { + label: t("app.close_remote_access"), + url: "javascript:window.close()" + } + ] + }) + } + // used by the app to detect a resumed app window.addEventListener("appResumed", () => { this.worker.terminate(); diff --git a/frontend/src/locales/de.ts b/frontend/src/locales/de.ts index 495a7ca..9fb191a 100644 --- a/frontend/src/locales/de.ts +++ b/frontend/src/locales/de.ts @@ -80,5 +80,8 @@ export const de ={ "imprint": "Impressum", "terms_of_use": "AGB", "privacy_notice": "Datenschutzerklärung" + }, + "app": { + "close_remote_access": "Fernzugriff schließen" } }; diff --git a/frontend/src/locales/en.ts b/frontend/src/locales/en.ts index 1c0d6ac..2510c5f 100644 --- a/frontend/src/locales/en.ts +++ b/frontend/src/locales/en.ts @@ -80,5 +80,8 @@ export const en = { "imprint": "Imprint", "terms_of_use": "Terms and Conditions", "privacy_notice": "Privacy Notice" + }, + "app": { + "close_remote_access": "Close Remote-Access" } };