Skip to content

Rename the mobile_guide_app_variant config values to be clearer. #30258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ complete re-branding/private labeling, a more personalised experience can be ach
download the app instead.
8. `mobile_guide_app_variant`: Optional. The mobile app that the user is prompted to download from the `/mobile_guide` page. When omitted
the mobile guide will be configured for the new Element X apps. Allowed values are as follows:
1. `classic`: Element Android/iOS.
2. `x`: Element X Android/iOS.
3. `pro`: Element Pro Android/iOS.
1. `element`: Element X Android/iOS.
2. `element-classic`: Element Classic Android/iOS.
3. `element-pro`: Element Pro Android/iOS.
9. `update_base_url`: For the desktop app only, the URL where to acquire update packages. If specified, must be a path to a directory
containing `macos` and `win32` directories, with the update packages within. Defaults to `https://packages.element.io/desktop/update/`
in production.
Expand Down
2 changes: 1 addition & 1 deletion src/IConfigOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export interface IConfigOptions {
};

mobile_guide_toast?: boolean;
mobile_guide_app_variant?: "classic" | "x" | "pro";
mobile_guide_app_variant?: "element" | "element-classic" | "element-pro";

default_theme?: "light" | "dark" | string; // custom themes are strings
default_country_code?: string; // ISO 3166 alpha2 country code
Expand Down
8 changes: 4 additions & 4 deletions src/vector/mobile_guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<head>
<title>Element Mobile Guide</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-itunes-app" content="app-id=id1083446067" />
<meta name="apple-itunes-app" content="app-id=id1631335820" />
</head>

<body>
Expand Down Expand Up @@ -44,7 +44,7 @@
<h1 id="step1_heading">Download Element</h1>
<div class="mx_StoreLinks">
<a
href="https://apps.apple.com/app/element-messenger/id1083446067"
href="https://apps.apple.com/app/element-x-secure-chat-call/id1631335820"
target="_blank"
class="mx_StoreBadge"
id="app_store_link"
Expand All @@ -57,7 +57,7 @@ <h1 id="step1_heading">Download Element</h1>
/>
</a>
<a
href="https://play.google.com/store/apps/details?id=im.vector.app"
href="https://play.google.com/store/apps/details?id=io.element.android.x"
target="_blank"
class="mx_StoreBadge"
id="play_store_link"
Expand All @@ -73,7 +73,7 @@ <h1 id="step1_heading">Download Element</h1>
<p id="f_droid_section">
Also available on
<a
href="https://f-droid.org/packages/im.vector.app"
href="https://f-droid.org/packages/io.element.android.x"
target="_blank"
class="mx_ClearDecoration"
id="f_droid_link"
Expand Down
6 changes: 3 additions & 3 deletions src/vector/mobile_guide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "@fontsource/inter/600.css";
import { logger } from "matrix-js-sdk/src/logger";

import { getVectorConfig } from "../getconfig";
import { type MobileAppVariant, mobileApps, updateMobilePage } from "./mobile-apps.ts";
import { MobileAppVariant, mobileApps, updateMobilePage } from "./mobile-apps.ts";

function onBackToElementClick(): void {
// Cookie should expire in 4 hours
Expand Down Expand Up @@ -53,8 +53,8 @@ async function initPage(): Promise<void> {
const defaultHsUrl = config?.["default_hs_url"];
const defaultIsUrl = config?.["default_is_url"];

const appVariant = (config?.["mobile_guide_app_variant"] ?? "x") as MobileAppVariant;
const metadata = mobileApps[appVariant];
const appVariant = (config?.["mobile_guide_app_variant"] as MobileAppVariant) ?? MobileAppVariant.X;
const metadata = mobileApps[appVariant] ?? mobileApps[MobileAppVariant.X]; // Additional fallback in case mobile_guide_app_variant has an unexpected value.

const incompatibleOptions = [wkConfig, serverName, defaultHsUrl].filter((i) => !!i);
if (defaultHsUrl && (wkConfig || serverName)) {
Expand Down
6 changes: 3 additions & 3 deletions src/vector/mobile_guide/mobile-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Please see LICENSE files in the repository root for full details.
*/

export enum MobileAppVariant {
Classic = "classic",
X = "x",
Pro = "pro",
Classic = "element-classic",
X = "element",
Pro = "element-pro",
}

export interface MobileAppMetadata {
Expand Down
Loading