refactor: application dependency management (#2363)

This commit is contained in:
Mo
2023-07-23 15:54:31 -05:00
committed by GitHub
parent e698b1c990
commit a77535456c
299 changed files with 7415 additions and 4890 deletions

View File

@@ -26,7 +26,7 @@ const BiometricsLock = ({ application }: Props) => {
const hasBiometricsSupport = async () => {
const hasBiometricsAvailable = await (
application.deviceInterface as MobileDeviceInterface
application.device as MobileDeviceInterface
).getDeviceBiometricsAvailability?.()
setSupportsBiometrics(hasBiometricsAvailable)
}

View File

@@ -37,7 +37,7 @@ const ErroredItems: FunctionComponent = () => {
}
const deleteItems = async (items: EncryptedItemInterface[]): Promise<void> => {
const confirmed = await application.alertService.confirm(
const confirmed = await application.alerts.confirm(
`Are you sure you want to permanently delete ${items.length} item(s)?`,
undefined,
'Delete',
@@ -58,7 +58,7 @@ const ErroredItems: FunctionComponent = () => {
const errorOrTrue = application.canAttemptDecryptionOfItem(item)
if (errorOrTrue instanceof ClientDisplayableError) {
void application.alertService.showErrorAlert(errorOrTrue)
void application.alerts.showErrorAlert(errorOrTrue)
return
}

View File

@@ -25,7 +25,7 @@ const MultitaskingPrivacy = ({ application }: Props) => {
setHasScreenshotPrivacy(enable)
application.protections.setMobileScreenshotPrivacyEnabled(enable)
;(application.deviceInterface as MobileDeviceInterface).setAndroidScreenshotPrivacy(enable)
;(application.device as MobileDeviceInterface).setAndroidScreenshotPrivacy(enable)
}
const screenshotPrivacyFeatureText = isIOS() ? 'Multitasking Privacy' : 'Multitasking/Screenshot Privacy'

View File

@@ -24,7 +24,7 @@ const Privacy: FunctionComponent<Props> = ({ application }: Props) => {
await application.settings.updateSetting(settingName, payload, false)
return true
} catch (e) {
application.alertService.alert(STRING_FAILED_TO_UPDATE_USER_SETTING).catch(console.error)
application.alerts.alert(STRING_FAILED_TO_UPDATE_USER_SETTING).catch(console.error)
return false
}
}