mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
17 lines
567 B
TypeScript
17 lines
567 B
TypeScript
import { Capacitor } from '@capacitor/core';
|
|||
|
|
import type { UploadMode } from './types';
|
||
|
|
|
||
|
|
/** Web runtime = web browser, not Electron */
|
||
|
|
export function isWebRuntime(): boolean {
|
||
|
|
return Capacitor.getPlatform() === 'web' && !window.electronApi?.isElectron;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Whether to show the upload CTA in post/reply forms.
|
||
|
|
* On web runtime, always true (for app promotion); otherwise true when uploadMode !== 'none'.
|
||
|
|
*/
|
||
|
|
export function getShowUploadControls(uploadMode: UploadMode, isWeb: boolean): boolean {
|
||
|
|
if (isWeb) return true;
|
||
|
|
return uploadMode !== 'none';
|
||
|
|
}
|