forked from Blendman974/faceclaw
Don't show the Compass app on hardware (ie G1s) that can't support it
This commit is contained in:
1 parent
38c52ebc31
commit
0cc263c5d2
16 files changed
+202
-49
No files matched your search
@@ -195,8 +195,8 @@ const LOW_BATTERY_PERCENT = 5;
|
||||
const EVEN_APP_DETECTED_MESSAGE =
|
||||
"The Even Realities app appears to be running. If Faceclaw has trouble connecting, open its app settings and force stop it.";
|
||||
|
||||
// The launcher grid's app list; also fixes the app ids apps.launch accepts.
|
||||
const LAUNCHABLE_APPS = ALL_APPS.filter((app) => app.showInLauncher !== false);
|
||||
// The launcher grid's app list for the paired glasses; also fixes the app ids apps.launch accepts.
|
||||
const launchableApps = () => ALL_APPS.filter((app) => app.showInLauncher !== false && app.isSupported?.() !== false);
|
||||
|
||||
/**
|
||||
* The global settings window viewport sizes depend on: the paired glasses'
|
||||
@@ -422,7 +422,7 @@ class DashboardController {
|
||||
registerRoamTools((appId) => this.launchApp(appId));
|
||||
// apps.* tools mirror the launcher grid and sidebar (launch, focus, close).
|
||||
registerWindowTools({
|
||||
apps: LAUNCHABLE_APPS,
|
||||
apps: launchableApps,
|
||||
launchApp: (appId) => this.launchApp(appId),
|
||||
requestShellRender: () => this.requestShellRender(),
|
||||
});
|
||||
@@ -506,7 +506,7 @@ class DashboardController {
|
||||
assistant: text => shell.sendToAssistant(text),
|
||||
});
|
||||
this.wearRemote = new WearRemote({
|
||||
apps: LAUNCHABLE_APPS,
|
||||
apps: launchableApps,
|
||||
injectInput: (kind) => this.injectSyntheticRingInput(kind, "watch"),
|
||||
launchApp: (appId) => this.launchApp(appId),
|
||||
connect: () => this.connect(),
|
||||
|
||||
@@ -272,7 +272,7 @@ export class IosPreviewController {
|
||||
// The header's EvenHub phone-UI button hides while that UI is showing.
|
||||
onPhoneShownChanged(() => this.syncEvenHubPhoneUi())
|
||||
registerSystemTools()
|
||||
registerWindowTools({ apps: ALL_APPS.filter(app => !iosAppUnavailableReason(app.appId)),
|
||||
registerWindowTools({ apps: () => ALL_APPS.filter(app => app.isSupported?.() !== false && !iosAppUnavailableReason(app.appId)),
|
||||
launchApp: id => this.launchApp(id), requestShellRender: () => this.requestShellRender() })
|
||||
registerNavigateTools(id => this.launchApp(id))
|
||||
registerRoamTools(id => this.launchApp(id))
|
||||
@@ -280,7 +280,7 @@ export class IosPreviewController {
|
||||
iosVoiceInput.onSpeechEnd(() => this.syncContinuousCapture())
|
||||
for (const app of ALL_APPS) if (app.appId !== 'launcher' && !iosAppUnavailableReason(app.appId)) app.boot?.(this.buildAppContext(app))
|
||||
this.wearRemote = new WearRemote({
|
||||
apps: ALL_APPS.filter(app => app.showInLauncher !== false && !iosAppUnavailableReason(app.appId)),
|
||||
apps: () => ALL_APPS.filter(app => app.showInLauncher !== false && app.isSupported?.() !== false && !iosAppUnavailableReason(app.appId)),
|
||||
injectInput: kind => this.injectWatchInput(kind),
|
||||
launchApp: id => this.launchApp(id),
|
||||
// The watch's Connect/Disconnect are explicit user choices, like the phone's own buttons.
|
||||
|
||||
@@ -115,8 +115,8 @@ const WATCH_BATTERY_MAX_AGE_MS = 4 * 60 * 60_000;
|
||||
|
||||
/** What the dashboard controller lends the watch remote. */
|
||||
export type WearRemoteHost = {
|
||||
/** The launcher-grid apps; installed EvenHub packages are added dynamically. */
|
||||
apps: readonly AppDefinition[];
|
||||
/** The launcher-grid apps for the paired glasses; installed EvenHub packages are added dynamically. */
|
||||
apps: () => readonly AppDefinition[];
|
||||
injectInput: (kind: WearRemoteInputKind) => Promise<void>;
|
||||
launchApp: (appId: string) => Promise<void>;
|
||||
connect: () => Promise<void>;
|
||||
@@ -320,7 +320,7 @@ export class WearRemote {
|
||||
|
||||
/** Launchable apps, matching the launcher grid and the apps.launch tool. */
|
||||
private listApps(): Array<{ appId: string; title: string }> {
|
||||
const apps = this.host.apps.map((app) => ({ appId: app.appId, title: app.title }));
|
||||
const apps = this.host.apps().map((app) => ({ appId: app.appId, title: app.title }));
|
||||
for (const installed of getInstalledEvenHubApps()) {
|
||||
apps.push({ appId: installedEvenHubAppId(installed.packageId), title: installed.name });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user