mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-16 17:03:00 -03:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
648083fbf4 | ||
|
|
09316dac9e | ||
|
|
73185e7cbc | ||
|
|
c36c940a79 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydralauncher",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "Hydra",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "Los Broxas",
|
||||
|
||||
@@ -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, "/");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user