aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index b009ebe..e93ffb3 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -470,9 +470,21 @@ export async function minimizeToTray(labels) {
return bridge.minimizeToTray(labels);
}
+/**
+ * Translate the tray menu the app created at launch.
+ *
+ * The main process has no i18n -- a second string table is how two of them
+ * start disagreeing -- so the labels come from here, once the catalogue has
+ * loaded. A no-op in a browser and on macOS, where there is no indicator.
+ */
+export async function setTrayLabels(labels) {
+ if (!bridge || !bridge.setTrayLabels) return false;
+ return bridge.setTrayLabels(labels);
+}
+
export default { isNative, hubBase, capabilities, secrets, nativeSave,
apiFetch, device, bridgeMessage, folder, rootPicker, node,
- cast, minimizeToTray };
+ cast, minimizeToTray, setTrayLabels };
// Also a global, because `transport.js` is loaded as a classic script — it
// predates the module graph and exposes `MeshBayTransport` the same way. The
@@ -482,5 +494,5 @@ if (typeof window !== 'undefined') {
window.MeshBayPlatform = { isNative, hubBase, capabilities, secrets,
nativeSave, apiFetch, device,
bridgeMessage, folder, rootPicker, node,
- cast, minimizeToTray };
+ cast, minimizeToTray, setTrayLabels };
}