mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: add intercom user id
This commit is contained in:
parent
20c001914a
commit
2828640ed7
4 changed files with 14 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { appVersion, defaultDownloadsPath } from "@main/constants";
|
import { appVersion, defaultDownloadsPath, isStaging } from "@main/constants";
|
||||||
import { ipcMain } from "electron";
|
import { ipcMain } from "electron";
|
||||||
|
|
||||||
import "./catalogue/get-catalogue";
|
import "./catalogue/get-catalogue";
|
||||||
|
@ -72,5 +72,6 @@ import "./misc/show-item-in-folder";
|
||||||
|
|
||||||
ipcMain.handle("ping", () => "pong");
|
ipcMain.handle("ping", () => "pong");
|
||||||
ipcMain.handle("getVersion", () => appVersion);
|
ipcMain.handle("getVersion", () => appVersion);
|
||||||
|
ipcMain.handle("isStaging", () => isStaging);
|
||||||
ipcMain.handle("isPortableVersion", () => isPortableVersion());
|
ipcMain.handle("isPortableVersion", () => isPortableVersion());
|
||||||
ipcMain.handle("getDefaultDownloadsPath", () => defaultDownloadsPath);
|
ipcMain.handle("getDefaultDownloadsPath", () => defaultDownloadsPath);
|
||||||
|
|
|
@ -198,6 +198,7 @@ contextBridge.exposeInMainWorld("electron", {
|
||||||
ping: () => ipcRenderer.invoke("ping"),
|
ping: () => ipcRenderer.invoke("ping"),
|
||||||
getVersion: () => ipcRenderer.invoke("getVersion"),
|
getVersion: () => ipcRenderer.invoke("getVersion"),
|
||||||
getDefaultDownloadsPath: () => ipcRenderer.invoke("getDefaultDownloadsPath"),
|
getDefaultDownloadsPath: () => ipcRenderer.invoke("getDefaultDownloadsPath"),
|
||||||
|
isStaging: () => ipcRenderer.invoke("isStaging"),
|
||||||
isPortableVersion: () => ipcRenderer.invoke("isPortableVersion"),
|
isPortableVersion: () => ipcRenderer.invoke("isPortableVersion"),
|
||||||
openExternal: (src: string) => ipcRenderer.invoke("openExternal", src),
|
openExternal: (src: string) => ipcRenderer.invoke("openExternal", src),
|
||||||
openCheckout: () => ipcRenderer.invoke("openCheckout"),
|
openCheckout: () => ipcRenderer.invoke("openCheckout"),
|
||||||
|
|
|
@ -54,13 +54,16 @@ export function Sidebar() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (userDetails) {
|
if (userDetails) {
|
||||||
update({
|
window.electron.isStaging().then((isStaging) => {
|
||||||
name: userDetails.displayName,
|
update({
|
||||||
Username: userDetails.username,
|
user_id: userDetails.id + (isStaging ? "-staging" : ""),
|
||||||
email: userDetails.email ?? undefined,
|
name: userDetails.displayName,
|
||||||
Email: userDetails.email,
|
Username: userDetails.username,
|
||||||
"Subscription expiration date": userDetails?.subscription?.expiresAt,
|
email: userDetails.email ?? undefined,
|
||||||
"Payment status": userDetails?.subscription?.status,
|
Email: userDetails.email,
|
||||||
|
"Subscription expiration date": userDetails?.subscription?.expiresAt,
|
||||||
|
"Payment status": userDetails?.subscription?.status,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [userDetails, hasActiveSubscription]);
|
}, [userDetails, hasActiveSubscription]);
|
||||||
|
|
1
src/renderer/src/declaration.d.ts
vendored
1
src/renderer/src/declaration.d.ts
vendored
|
@ -162,6 +162,7 @@ declare global {
|
||||||
openExternal: (src: string) => Promise<void>;
|
openExternal: (src: string) => Promise<void>;
|
||||||
openCheckout: () => Promise<void>;
|
openCheckout: () => Promise<void>;
|
||||||
getVersion: () => Promise<string>;
|
getVersion: () => Promise<string>;
|
||||||
|
isStaging: () => Promise<boolean>;
|
||||||
ping: () => string;
|
ping: () => string;
|
||||||
getDefaultDownloadsPath: () => Promise<string>;
|
getDefaultDownloadsPath: () => Promise<string>;
|
||||||
isPortableVersion: () => Promise<boolean>;
|
isPortableVersion: () => Promise<boolean>;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue