feat: open checkout page

This commit is contained in:
Zamitto 2024-10-21 15:30:38 -03:00
parent 6ef1135ba2
commit 21fecb2c4e
6 changed files with 32 additions and 8 deletions

View file

@ -162,6 +162,7 @@ declare global {
/* Misc */
openExternal: (src: string) => Promise<void>;
openCheckout: () => Promise<void>;
getVersion: () => Promise<string>;
ping: () => string;
getDefaultDownloadsPath: () => Promise<string>;

View file

@ -34,7 +34,7 @@ export function GameDetailsContent() {
hasNSFWContentBlocked,
} = useContext(gameDetailsContext);
const { userDetails } = useUserDetails();
const { userDetails, hasActiveSubscription } = useUserDetails();
const { setShowCloudSyncModal, getGameBackupPreview } =
useContext(cloudSyncContext);
@ -103,6 +103,11 @@ export function GameDetailsContent() {
return;
}
if (!hasActiveSubscription) {
window.electron.openCheckout();
return;
}
setShowCloudSyncModal(true);
};