refactor: anyone can use e2ee except non-owner team members

This commit is contained in:
zhom
2026-03-24 00:55:51 +04:00
parent cd5fd2c970
commit 888631bc48
4 changed files with 9 additions and 17 deletions
+4 -3
View File
@@ -41,10 +41,11 @@ export function ProfileSyncDialog({
cloudUser.plan !== "free" &&
(cloudUser.subscriptionStatus === "active" ||
cloudUser.planPeriod === "lifetime");
// Encryption available to everyone except team members who aren't owners
const canUseEncryption =
isCloudSyncEligible &&
cloudUser != null &&
(cloudUser.plan !== "team" || cloudUser.teamRole === "owner");
cloudUser == null ||
cloudUser.plan !== "team" ||
cloudUser.teamRole === "owner";
const [isSaving, setIsSaving] = useState(false);
const [isSyncing, setIsSyncing] = useState(false);
const [syncMode, setSyncMode] = useState<SyncMode>(
+4 -5
View File
@@ -134,12 +134,11 @@ export function SettingsDialog({
} = usePermissions();
const { trialStatus } = useCommercialTrial();
const { user: cloudUser } = useCloudAuth();
// Encryption is available to everyone except team members who aren't owners
const canUseEncryption =
cloudUser != null &&
cloudUser.plan !== "free" &&
(cloudUser.subscriptionStatus === "active" ||
cloudUser.planPeriod === "lifetime") &&
(cloudUser.plan !== "team" || cloudUser.teamRole === "owner");
cloudUser == null ||
cloudUser.plan !== "team" ||
cloudUser.teamRole === "owner";
const {
currentLanguage,
changeLanguage,