Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

feat(app): Flatpak options and fixes with updater (#1509)

Nanakusabf004e6d7202
diff --git a/fluxer_app/src/features/app/state/Updater.ts b/fluxer_app/src/features/app/state/Updater.ts
index d220c3422..75e800685 100644
--- a/fluxer_app/src/features/app/state/Updater.ts
+++ b/fluxer_app/src/features/app/state/Updater.ts
@@ -556,11 +556,11 @@ class Updater {
if (this.isNative && this.nativeDownloadInFlight) {
return;
}
- if (this.isNative && this.nativeUnsupported?.reason === 'managed-package') {
+ if (this.isNative && this.nativeUnsupported?.reason === 'managed-package' && !this.updateInfo.web.available) {
pushUnsupportedUpdateModal('managed-package');
return;
}
- if (this.isNative && this.nativeManualUpdateAvailable) {
+ if (this.isNative && this.nativeManualUpdateAvailable && !this.nativeUnsupported) {
this.showManualNativeUpdateModal();
return;
}
diff --git a/fluxer_app/src/features/updater/commands/UpdaterModalCommands.tsx b/fluxer_app/src/features/updater/commands/UpdaterModalCommands.tsx
index 8f729779c..da2369621 100644
--- a/fluxer_app/src/features/updater/commands/UpdaterModalCommands.tsx
+++ b/fluxer_app/src/features/updater/commands/UpdaterModalCommands.tsx
@@ -7,7 +7,7 @@ import type {UpdaterDownloadOption} from '@app/features/platform/types/Electron'
import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
import {modal} from '@app/features/ui/commands/ModalCommands';
import {Combobox} from '@app/features/ui/components/form/FormCombobox';
-import {openExternalUrl} from '@app/features/ui/utils/NativeUtils';
+import {openExternalUrl, isCanaryDesktop} from '@app/features/ui/utils/NativeUtils';
import styles from '@app/features/updater/commands/UpdaterModalCommands.module.css';
import {i18n} from '@lingui/core';
import {msg} from '@lingui/core/macro';
@@ -76,6 +76,10 @@ const SYSTEM_MANAGED_UPDATE_BODY_DESCRIPTOR = msg({
message: 'This install is managed by your system. Update {productName} from your software center or package manager.',
comment: 'Desktop updater modal body for managed package builds such as Flatpak. productName is the app name.',
});
+const OPEN_SOFTWARE_CENTER_DESCRIPTOR = msg({
+ message: 'Open software center',
+ comment: 'Button label that opens the software center via appstream protocol.',
+});
const OPEN_DESKTOP_DOWNLOADS_DESCRIPTOR = msg({
message: 'Open desktop downloads',
comment: 'Button label that opens the Fluxer desktop downloads page in a browser.',
@@ -291,7 +295,15 @@ export function pushUnsupportedUpdateModal(
<ConfirmModal
title={i18n._(SYSTEM_MANAGED_INSTALL_DESCRIPTOR)}
description={i18n._(SYSTEM_MANAGED_UPDATE_BODY_DESCRIPTOR, {productName: PRODUCT_NAME})}
+ primaryText={i18n._(OPEN_SOFTWARE_CENTER_DESCRIPTOR)}
secondaryText={i18n._(CLOSE_DESCRIPTOR)}
+ onPrimary={() => {
+ const appstreamUrl = isCanaryDesktop()
+ ? 'appstream://app.fluxer.FluxerCanary'
+ : 'appstream://app.fluxer.Fluxer';
+
+ void openExternalUrl(appstreamUrl);
+ }}
data-flx="updater.updater-modal-commands.push-unsupported-update-modal.confirm-modal"
/>
);
diff --git a/fluxer_desktop/src/main/OpenExternal.ts b/fluxer_desktop/src/main/OpenExternal.ts
index f638ed323..27ac19f8f 100644
--- a/fluxer_desktop/src/main/OpenExternal.ts
+++ b/fluxer_desktop/src/main/OpenExternal.ts
@@ -4,7 +4,14 @@ import {APP_PROTOCOL} from '@electron/common/Constants';
import {shell} from 'electron';
const DEDUPE_WINDOW_MS = 500;
-const ALLOWED_EXTERNAL_URL_PROTOCOLS = new Set(['http:', 'https:', 'mailto:', 'tel:', `${APP_PROTOCOL}:`]);
+const ALLOWED_EXTERNAL_URL_PROTOCOLS = new Set([
+ 'http:',
+ 'https:',
+ 'mailto:',
+ 'tel:',
+ 'appstream:',
+ `${APP_PROTOCOL}:`,
+]);
const recentOpens = new Map<string, number>();
function getSafeExternalUrl(url: string): string | null {