mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +03:00
feat: open checkout with user language
This commit is contained in:
parent
34ec8467ec
commit
77e9de704d
@ -1,10 +1,16 @@
|
|||||||
import { shell } from "electron";
|
import { shell } from "electron";
|
||||||
import { registerEvent } from "../register-event";
|
import { registerEvent } from "../register-event";
|
||||||
import { userAuthRepository } from "@main/repository";
|
import {
|
||||||
|
userAuthRepository,
|
||||||
|
userPreferencesRepository,
|
||||||
|
} from "@main/repository";
|
||||||
import { HydraApi } from "@main/services";
|
import { HydraApi } from "@main/services";
|
||||||
|
|
||||||
const openCheckout = async (_event: Electron.IpcMainInvokeEvent) => {
|
const openCheckout = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||||
const userAuth = await userAuthRepository.findOne({ where: { id: 1 } });
|
const [userAuth, userPreferences] = await Promise.all([
|
||||||
|
userAuthRepository.findOne({ where: { id: 1 } }),
|
||||||
|
userPreferencesRepository.findOne({ where: { id: 1 } }),
|
||||||
|
]);
|
||||||
|
|
||||||
if (!userAuth) {
|
if (!userAuth) {
|
||||||
return;
|
return;
|
||||||
@ -16,6 +22,7 @@ const openCheckout = async (_event: Electron.IpcMainInvokeEvent) => {
|
|||||||
|
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
token: paymentToken,
|
token: paymentToken,
|
||||||
|
lng: userPreferences?.language || "en",
|
||||||
});
|
});
|
||||||
|
|
||||||
shell.openExternal(
|
shell.openExternal(
|
||||||
|
Loading…
Reference in New Issue
Block a user