mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-09-28 16:09:49 +01:00
Enable local backups for iOS primaries
Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com>
This commit is contained in:
co-authored by
ayumi-signal
parent
10db2b7562
commit
3c613243bf
@@ -280,7 +280,7 @@ import { MessageModel } from './models/messages.preload.ts';
|
||||
import { waitForEvent } from './shims/events.dom.ts';
|
||||
import { sendSyncRequests } from './textsecure/syncRequests.preload.ts';
|
||||
import { handleServerAlerts } from './util/handleServerAlerts.preload.ts';
|
||||
import { isLocalBackupsEnabled } from './util/isLocalBackupsEnabled.preload.ts';
|
||||
import { isLocalBackupsEnabled } from './util/isLocalBackupsEnabled.dom.ts';
|
||||
import { NavTab, SettingsPage, ProfileEditorPage } from './types/Nav.std.ts';
|
||||
import { initialize as initializeDonationService } from './services/donations.preload.ts';
|
||||
import { MessageRequestResponseSource } from './types/MessageRequestResponseEvent.std.ts';
|
||||
|
||||
@@ -83,7 +83,7 @@ import {
|
||||
import { FileStream } from './util/FileStream.node.ts';
|
||||
import { ToastType } from '../../types/Toast.dom.tsx';
|
||||
import { isAdhoc, isNightly } from '../../util/version.std.ts';
|
||||
import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.preload.ts';
|
||||
import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.dom.ts';
|
||||
import type { ValidateLocalBackupStructureResultType } from './util/localBackup.node.ts';
|
||||
import {
|
||||
writeLocalBackupMetadata,
|
||||
|
||||
@@ -99,7 +99,7 @@ import {
|
||||
SmartNotificationProfilesCreateFlow,
|
||||
SmartNotificationProfilesHome,
|
||||
} from './PreferencesNotificationProfiles.preload.tsx';
|
||||
import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.preload.ts';
|
||||
import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.dom.ts';
|
||||
import { getBackupKeyHash } from '../../services/backups/crypto.preload.ts';
|
||||
import { Emoji } from '../../axo/emoji.std.ts';
|
||||
import { AppProvider } from '../../windows/AppProvider.dom.tsx';
|
||||
|
||||
@@ -2,32 +2,16 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
import { isEnabled, type ConfigMapType } from '../RemoteConfig.dom.ts';
|
||||
import { type ConfigMapType } from '../RemoteConfig.dom.ts';
|
||||
import {
|
||||
isFeaturedEnabledNoRedux,
|
||||
isFeaturedEnabledSelector,
|
||||
} from './isFeatureEnabled.dom.ts';
|
||||
import { itemStorage } from '../textsecure/Storage.preload.ts';
|
||||
import { isNightly } from './version.std.ts';
|
||||
import { isTestOrMockEnvironment } from '../environment.std.ts';
|
||||
|
||||
const IOS_USER_AGENT = 'OWI';
|
||||
|
||||
export function isLocalBackupsEnabled(reduxArgs?: {
|
||||
currentVersion: string;
|
||||
remoteConfig: ReadonlyDeep<ConfigMapType> | undefined;
|
||||
}): boolean {
|
||||
// This is a temporary guard until iOS supports importing local backups
|
||||
// Android no longer sends its OWA agent string, so we have to rely on iOS
|
||||
if (
|
||||
itemStorage.get('userAgent') === IOS_USER_AGENT &&
|
||||
!isNightly(window.getVersion()) &&
|
||||
!isTestOrMockEnvironment() &&
|
||||
!isEnabled('desktop.internalUser', reduxArgs?.remoteConfig)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (reduxArgs) {
|
||||
return isFeaturedEnabledSelector({
|
||||
currentVersion: reduxArgs.currentVersion,
|
||||
Reference in New Issue
Block a user