diff --git a/ts/background.preload.ts b/ts/background.preload.ts index 14d7e54eba..84b1845a5f 100644 --- a/ts/background.preload.ts +++ b/ts/background.preload.ts @@ -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'; diff --git a/ts/services/backups/index.preload.ts b/ts/services/backups/index.preload.ts index 8f773970d3..7f1acc9197 100644 --- a/ts/services/backups/index.preload.ts +++ b/ts/services/backups/index.preload.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, diff --git a/ts/state/smart/Preferences.preload.tsx b/ts/state/smart/Preferences.preload.tsx index f5f799424b..fc1c135372 100644 --- a/ts/state/smart/Preferences.preload.tsx +++ b/ts/state/smart/Preferences.preload.tsx @@ -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'; diff --git a/ts/util/isLocalBackupsEnabled.preload.ts b/ts/util/isLocalBackupsEnabled.dom.ts similarity index 53% rename from ts/util/isLocalBackupsEnabled.preload.ts rename to ts/util/isLocalBackupsEnabled.dom.ts index e3ea884146..bb0203448f 100644 --- a/ts/util/isLocalBackupsEnabled.preload.ts +++ b/ts/util/isLocalBackupsEnabled.dom.ts @@ -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 | 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,