-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1203 from hydralauncher/fix/replace-nbsp-with-space
fix: replace nbsp with space
- Loading branch information
Showing
9 changed files
with
90 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { userSubscriptionRepository } from "@main/repository"; | ||
import axios from "axios"; | ||
import { appVersion } from "@main/constants"; | ||
|
||
export class HydraAnalytics { | ||
private static instance = axios.create({ | ||
baseURL: import.meta.env.MAIN_VITE_ANALYTICS_API_URL, | ||
headers: { "User-Agent": `Hydra Launcher v${appVersion}` }, | ||
}); | ||
|
||
private static async hasActiveSubscription() { | ||
const userSubscription = await userSubscriptionRepository.findOne({ | ||
where: { id: 1 }, | ||
}); | ||
|
||
return ( | ||
userSubscription?.expiresAt && userSubscription.expiresAt > new Date() | ||
); | ||
} | ||
|
||
static async postDownload(hash: string) { | ||
const hasSubscription = await this.hasActiveSubscription(); | ||
|
||
return this.instance | ||
.post("/track", { | ||
event: "download", | ||
attributes: { | ||
hash, | ||
hasSubscription, | ||
}, | ||
}) | ||
.then((response) => response.data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.