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

This commit is contained in:
Nanakusa authored and GitHub committed 2026-07-31 14:15:46 +02:00
1 parent 9d33993413
commit bf004e6d72
3 files changed
+23 -4

No files matched your search

+2 -2
View File
@@ -556,11 +556,11 @@ class Updater {
if (this.isNative && this.nativeDownloadInFlight) { if (this.isNative && this.nativeDownloadInFlight) {
return; return;
} }
if (this.isNative && this.nativeUnsupported?.reason === 'managed-package') { if (this.isNative && this.nativeUnsupported?.reason === 'managed-package' && !this.updateInfo.web.available) {
pushUnsupportedUpdateModal('managed-package'); pushUnsupportedUpdateModal('managed-package');
return; return;
} }
if (this.isNative && this.nativeManualUpdateAvailable) { if (this.isNative && this.nativeManualUpdateAvailable && !this.nativeUnsupported) {
this.showManualNativeUpdateModal(); this.showManualNativeUpdateModal();
return; return;
} }
@@ -7,7 +7,7 @@ import type {UpdaterDownloadOption} from '@app/features/platform/types/Electron'
import * as ModalCommands from '@app/features/ui/commands/ModalCommands'; import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
import {modal} from '@app/features/ui/commands/ModalCommands'; import {modal} from '@app/features/ui/commands/ModalCommands';
import {Combobox} from '@app/features/ui/components/form/FormCombobox'; 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 styles from '@app/features/updater/commands/UpdaterModalCommands.module.css';
import {i18n} from '@lingui/core'; import {i18n} from '@lingui/core';
import {msg} from '@lingui/core/macro'; 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.', 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.', 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({ const OPEN_DESKTOP_DOWNLOADS_DESCRIPTOR = msg({
message: 'Open desktop downloads', message: 'Open desktop downloads',
comment: 'Button label that opens the Fluxer desktop downloads page in a browser.', comment: 'Button label that opens the Fluxer desktop downloads page in a browser.',
@@ -291,7 +295,15 @@ export function pushUnsupportedUpdateModal(
<ConfirmModal <ConfirmModal
title={i18n._(SYSTEM_MANAGED_INSTALL_DESCRIPTOR)} title={i18n._(SYSTEM_MANAGED_INSTALL_DESCRIPTOR)}
description={i18n._(SYSTEM_MANAGED_UPDATE_BODY_DESCRIPTOR, {productName: PRODUCT_NAME})} description={i18n._(SYSTEM_MANAGED_UPDATE_BODY_DESCRIPTOR, {productName: PRODUCT_NAME})}
primaryText={i18n._(OPEN_SOFTWARE_CENTER_DESCRIPTOR)}
secondaryText={i18n._(CLOSE_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" data-flx="updater.updater-modal-commands.push-unsupported-update-modal.confirm-modal"
/> />
); );
+8 -1
View File
@@ -4,7 +4,14 @@ import {APP_PROTOCOL} from '@electron/common/Constants';
import {shell} from 'electron'; import {shell} from 'electron';
const DEDUPE_WINDOW_MS = 500; 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>(); const recentOpens = new Map<string, number>();
function getSafeExternalUrl(url: string): string | null { function getSafeExternalUrl(url: string): string | null {