Merge pull request #2709 from robintown/app-prompt-config
Add a config option to disable the app prompt
This commit is contained in:
@@ -98,6 +98,8 @@ confineToRoom: boolean; (default: false)
|
|||||||
Whether upon entering a room, the user should be prompted to launch the
|
Whether upon entering a room, the user should be prompted to launch the
|
||||||
native mobile app. (Affects only Android and iOS.)
|
native mobile app. (Affects only Android and iOS.)
|
||||||
|
|
||||||
|
The app prompt must also be enabled in the config for this to take effect.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
appPrompt: boolean; (default: true)
|
appPrompt: boolean; (default: true)
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ export interface UrlParams {
|
|||||||
/**
|
/**
|
||||||
* Whether upon entering a room, the user should be prompted to launch the
|
* Whether upon entering a room, the user should be prompted to launch the
|
||||||
* native mobile app. (Affects only Android and iOS.)
|
* native mobile app. (Affects only Android and iOS.)
|
||||||
|
*
|
||||||
|
* The app prompt must also be enabled in the config for this to take effect.
|
||||||
*/
|
*/
|
||||||
appPrompt: boolean;
|
appPrompt: boolean;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ export interface ConfigOptions {
|
|||||||
*/
|
*/
|
||||||
enable_video?: boolean;
|
enable_video?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether upon entering a room, the user should be prompted to launch the
|
||||||
|
* native mobile app. (Affects only Android and iOS.)
|
||||||
|
*
|
||||||
|
* Note that this can additionally be disabled by the app's URL parameters.
|
||||||
|
*/
|
||||||
|
app_prompt?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overrides members from ConfigOptions that are always provided by the
|
// Overrides members from ConfigOptions that are always provided by the
|
||||||
@@ -103,6 +111,7 @@ export interface ResolvedConfigOptions extends ConfigOptions {
|
|||||||
enable_audio: boolean;
|
enable_audio: boolean;
|
||||||
enable_video: boolean;
|
enable_video: boolean;
|
||||||
};
|
};
|
||||||
|
app_prompt: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DEFAULT_CONFIG: ResolvedConfigOptions = {
|
export const DEFAULT_CONFIG: ResolvedConfigOptions = {
|
||||||
@@ -117,4 +126,5 @@ export const DEFAULT_CONFIG: ResolvedConfigOptions = {
|
|||||||
enable_audio: true,
|
enable_audio: true,
|
||||||
enable_video: true,
|
enable_video: true,
|
||||||
},
|
},
|
||||||
|
app_prompt: true,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import { E2eeType } from "../e2ee/e2eeType";
|
|||||||
import { useProfile } from "../profile/useProfile";
|
import { useProfile } from "../profile/useProfile";
|
||||||
import { useMuteStates } from "./MuteStates";
|
import { useMuteStates } from "./MuteStates";
|
||||||
import { useOptInAnalytics } from "../settings/settings";
|
import { useOptInAnalytics } from "../settings/settings";
|
||||||
|
import { Config } from "../config/Config";
|
||||||
|
|
||||||
export const RoomPage: FC = () => {
|
export const RoomPage: FC = () => {
|
||||||
const {
|
const {
|
||||||
@@ -185,6 +186,7 @@ export const RoomPage: FC = () => {
|
|||||||
{content}
|
{content}
|
||||||
{/* On Android and iOS, show a prompt to launch the mobile app. */}
|
{/* On Android and iOS, show a prompt to launch the mobile app. */}
|
||||||
{appPrompt &&
|
{appPrompt &&
|
||||||
|
Config.get().app_prompt &&
|
||||||
(platform === "android" || platform === "ios") &&
|
(platform === "android" || platform === "ios") &&
|
||||||
roomId && <AppSelectionModal roomId={roomId} />}
|
roomId && <AppSelectionModal roomId={roomId} />}
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user