Compare commits

..

4 Commits

Author SHA1 Message Date
Zamitto
648083fbf4 chore: bump version 2024-10-23 00:07:50 -03:00
Zamitto
09316dac9e fix: isPortableVersion 2024-10-23 00:07:45 -03:00
Zamitto
73185e7cbc fix: small adjustment 2024-10-22 22:33:23 -03:00
Zamitto
c36c940a79 fix: subscription 2024-10-22 22:25:35 -03:00
5 changed files with 8 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "hydralauncher",
"version": "3.0.0",
"version": "3.0.1",
"description": "Hydra",
"main": "./out/main/index.js",
"author": "Los Broxas",

View File

@@ -26,8 +26,9 @@ export const requestWebPage = async (url: string) => {
return window.document;
};
export const isPortableVersion = () =>
process.env.PORTABLE_EXECUTABLE_FILE !== null;
export const isPortableVersion = () => {
return !!process.env.PORTABLE_EXECUTABLE_FILE;
};
export const normalizePath = (str: string) =>
path.posix.normalize(str).replace(/\\/g, "/");

View File

@@ -44,7 +44,7 @@ export class HydraApi {
return this.userAuth.authToken !== "";
}
private static hasCloudSubscription() {
private static hasActiveSubscription() {
return (
this.userAuth.subscription?.expiresAt &&
this.userAuth.subscription.expiresAt > new Date()
@@ -279,7 +279,7 @@ export class HydraApi {
}
if (needsSubscription) {
if (!(await this.hasCloudSubscription())) {
if (!(await this.hasActiveSubscription())) {
throw new SubscriptionRequiredError();
}
}

View File

@@ -8,7 +8,7 @@ import { UserFriendModalTab } from "@renderer/pages/shared-modals/user-friend-mo
import SteamLogo from "@renderer/assets/steam-logo.svg?react";
import { Avatar } from "../avatar/avatar";
const LONG_POLLING_INTERVAL = 60_000;
const LONG_POLLING_INTERVAL = 120_000;
export function SidebarProfile() {
const navigate = useNavigate();

View File

@@ -128,12 +128,8 @@ export function useUserDetails() {
const unblockUser = (userId: string) => window.electron.unblockUser(userId);
const hasActiveSubscription = useMemo(() => {
if (!userDetails?.subscription?.plan) {
return false;
}
return (
userDetails.subscription.expiresAt == null ||
userDetails?.subscription?.expiresAt &&
new Date(userDetails.subscription.expiresAt) > new Date()
);
}, [userDetails]);