Skip to content

Commit

Permalink
fix: correctly check if cloud backups are available for the user (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
vardan-arm authored Feb 3, 2022
1 parent fc3d575 commit 8388265
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,22 @@ export const CloudLink: FunctionComponent<Props> = ({ application }) => {
}, [application]);

useEffect(() => {
const cloudBackupsFeatureStatus = application.getFeatureStatus(
FeatureIdentifier.CloudLink
const dailyDropboxBackupStatus = application.getFeatureStatus(
FeatureIdentifier.DailyDropboxBackup
);
setIsEntitledForCloudBackups(
cloudBackupsFeatureStatus === FeatureStatus.Entitled
const dailyGdriveBackupStatus = application.getFeatureStatus(
FeatureIdentifier.DailyGDriveBackup
);
const dailyOneDriveBackupStatus = application.getFeatureStatus(
FeatureIdentifier.DailyOneDriveBackup
);
const isCloudBackupsAllowed = [
dailyDropboxBackupStatus,
dailyGdriveBackupStatus,
dailyOneDriveBackupStatus,
].every((status) => status === FeatureStatus.Entitled);

setIsEntitledForCloudBackups(isCloudBackupsAllowed);
loadIsFailedCloudBackupEmailMutedSetting();
}, [application, loadIsFailedCloudBackupEmailMutedSetting]);

Expand Down

0 comments on commit 8388265

Please sign in to comment.