Initial commit: code as received (Create/Anything export)
Insole-production time tracker exported from the Create/Anything AI platform. Baseline snapshot before any reverse-engineering or cleanup. - apps/mobile: Expo Router app (iOS/Android/web), the only workspace - publisher/: standalone OpenNext/AWS deploy tooling for the web side - Backend (/api/tasks, /api/logs + DB) lives remotely, not in this repo
This commit is contained in:
56
apps/mobile/polyfills/web/webBrowser.web.ts
Normal file
56
apps/mobile/polyfills/web/webBrowser.web.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
export enum WebBrowserResultType {
|
||||
CANCEL = 'cancel',
|
||||
DISMISS = 'dismiss',
|
||||
OPENED = 'opened',
|
||||
LOCKED = 'locked',
|
||||
}
|
||||
|
||||
interface WebBrowserResult {
|
||||
type: WebBrowserResultType;
|
||||
}
|
||||
|
||||
let _openWindow: Window | null = null;
|
||||
|
||||
export async function openBrowserAsync(
|
||||
url: string,
|
||||
_options?: {
|
||||
toolbarColor?: string;
|
||||
controlsColor?: string;
|
||||
secondaryToolbarColor?: string;
|
||||
enableBarCollapsing?: boolean;
|
||||
showTitle?: boolean;
|
||||
enableDefaultShareMenuItem?: boolean;
|
||||
windowName?: string;
|
||||
windowFeatures?: string;
|
||||
}
|
||||
): Promise<WebBrowserResult> {
|
||||
_openWindow = window.open(url, '_blank');
|
||||
return { type: WebBrowserResultType.OPENED };
|
||||
}
|
||||
|
||||
export async function openAuthSessionAsync(
|
||||
url: string,
|
||||
_redirectUrl?: string,
|
||||
_options?: { showInRecents?: boolean }
|
||||
): Promise<WebBrowserResult & { url?: string }> {
|
||||
const authWindow = window.open(url, '_blank');
|
||||
if (!authWindow) {
|
||||
return { type: WebBrowserResultType.CANCEL };
|
||||
}
|
||||
return { type: WebBrowserResultType.OPENED };
|
||||
}
|
||||
|
||||
export function dismissBrowser(): void {
|
||||
if (_openWindow && !_openWindow.closed) {
|
||||
_openWindow.close();
|
||||
_openWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
export async function warmUpAsync(): Promise<void> {}
|
||||
export async function coolDownAsync(): Promise<void> {}
|
||||
export async function mayInitWithUrlAsync(
|
||||
_url: string
|
||||
): Promise<{ servicePackage: string | null }> {
|
||||
return { servicePackage: null };
|
||||
}
|
||||
Reference in New Issue
Block a user