mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
fix: fixing backups per game limit as conditional
This commit is contained in:
parent
726c753568
commit
16259b5399
@ -88,6 +88,9 @@ export function CloudSyncModal({ visible, onClose }: CloudSyncModalProps) {
|
|||||||
}
|
}
|
||||||
}, [getGameBackupPreview, visible]);
|
}, [getGameBackupPreview, visible]);
|
||||||
|
|
||||||
|
const userDetails = useAppSelector((state) => state.userDetails.userDetails);
|
||||||
|
const backupsPerGameLimit = userDetails?.quirks?.backupsPerGameLimit ?? 0;
|
||||||
|
|
||||||
const backupStateLabel = useMemo(() => {
|
const backupStateLabel = useMemo(() => {
|
||||||
if (uploadingBackup) {
|
if (uploadingBackup) {
|
||||||
return (
|
return (
|
||||||
@ -120,7 +123,7 @@ export function CloudSyncModal({ visible, onClose }: CloudSyncModalProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (artifacts.length >= 2) {
|
if (artifacts.length >= backupsPerGameLimit) {
|
||||||
return t("max_number_of_artifacts_reached");
|
return t("max_number_of_artifacts_reached");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,14 +143,12 @@ export function CloudSyncModal({ visible, onClose }: CloudSyncModalProps) {
|
|||||||
restoringBackup,
|
restoringBackup,
|
||||||
loadingPreview,
|
loadingPreview,
|
||||||
artifacts,
|
artifacts,
|
||||||
|
backupsPerGameLimit,
|
||||||
t,
|
t,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const disableActions = uploadingBackup || restoringBackup || deletingArtifact;
|
const disableActions = uploadingBackup || restoringBackup || deletingArtifact;
|
||||||
|
|
||||||
const userDetails = useAppSelector((state) => state.userDetails.userDetails);
|
|
||||||
const backupsPerGameLimit = userDetails?.quirks.backupsPerGameLimit ?? 0;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
visible={visible}
|
visible={visible}
|
||||||
|
@ -268,7 +268,7 @@ export interface UserDetails {
|
|||||||
profileVisibility: ProfileVisibility;
|
profileVisibility: ProfileVisibility;
|
||||||
bio: string;
|
bio: string;
|
||||||
subscription: Subscription | null;
|
subscription: Subscription | null;
|
||||||
quirks: {
|
quirks?: {
|
||||||
backupsPerGameLimit: number;
|
backupsPerGameLimit: number;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user