mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
fix: small adjustment
This commit is contained in:
parent
c36c940a79
commit
73185e7cbc
@ -44,7 +44,7 @@ export class HydraApi {
|
|||||||
return this.userAuth.authToken !== "";
|
return this.userAuth.authToken !== "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static hasCloudSubscription() {
|
private static hasActiveSubscription() {
|
||||||
return (
|
return (
|
||||||
this.userAuth.subscription?.expiresAt &&
|
this.userAuth.subscription?.expiresAt &&
|
||||||
this.userAuth.subscription.expiresAt > new Date()
|
this.userAuth.subscription.expiresAt > new Date()
|
||||||
@ -279,7 +279,7 @@ export class HydraApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (needsSubscription) {
|
if (needsSubscription) {
|
||||||
if (!(await this.hasCloudSubscription())) {
|
if (!(await this.hasActiveSubscription())) {
|
||||||
throw new SubscriptionRequiredError();
|
throw new SubscriptionRequiredError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,12 +128,8 @@ export function useUserDetails() {
|
|||||||
const unblockUser = (userId: string) => window.electron.unblockUser(userId);
|
const unblockUser = (userId: string) => window.electron.unblockUser(userId);
|
||||||
|
|
||||||
const hasActiveSubscription = useMemo(() => {
|
const hasActiveSubscription = useMemo(() => {
|
||||||
if (!userDetails?.subscription?.plan) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
userDetails.subscription.expiresAt &&
|
userDetails?.subscription?.expiresAt &&
|
||||||
new Date(userDetails.subscription.expiresAt) > new Date()
|
new Date(userDetails.subscription.expiresAt) > new Date()
|
||||||
);
|
);
|
||||||
}, [userDetails]);
|
}, [userDetails]);
|
||||||
|
Loading…
Reference in New Issue
Block a user