Unsupported OS Dialog

This commit is contained in:
Fedor Indutny 2023-01-18 15:31:10 -08:00 committed by GitHub
parent c6e184016b
commit ac50af52d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 776 additions and 224 deletions

View file

@ -14,13 +14,10 @@ import type { WidthBreakpoint } from './_util';
export type PropsType = {
containerWidthBreakpoint: WidthBreakpoint;
dialogType: DialogType;
didSnooze: boolean;
dismissDialog: () => void;
downloadSize?: number;
downloadedSize?: number;
hasNetworkDialog: boolean;
i18n: LocalizerType;
showEventsCount: number;
snoozeUpdate: () => void;
startUpdate: () => void;
version?: string;
@ -33,29 +30,15 @@ const BETA_DOWNLOAD_URL = 'https://support.signal.org/beta';
export function DialogUpdate({
containerWidthBreakpoint,
dialogType,
didSnooze,
dismissDialog,
downloadSize,
downloadedSize,
hasNetworkDialog,
i18n,
snoozeUpdate,
startUpdate,
version,
currentVersion,
}: PropsType): JSX.Element | null {
if (hasNetworkDialog) {
return null;
}
if (dialogType === DialogType.None) {
return null;
}
if (didSnooze) {
return null;
}
if (dialogType === DialogType.Cannot_Update) {
const url = isBeta(currentVersion)
? BETA_DOWNLOAD_URL
@ -174,6 +157,11 @@ export function DialogUpdate({
);
}
if (dialogType === DialogType.UnsupportedOS) {
// Displayed as UnsupportedOSDialog in LeftPane
return null;
}
let title = i18n('autoUpdateNewVersionTitle');
if (