fix: show proper app version
This commit is contained in:
Vendored
+1
@@ -49,6 +49,7 @@ declare global {
|
|||||||
};
|
};
|
||||||
electronApp: {
|
electronApp: {
|
||||||
setDockBadge: (count: number) => void;
|
setDockBadge: (count: number) => void;
|
||||||
|
getVersion: () => Promise<string>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { ChevronRight, LogOut, User, Info, Shield, Mail, Mic } from "lucide-react";
|
import { ChevronRight, LogOut, User, Info, Shield, Mail, Mic } from "lucide-react";
|
||||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||||
@@ -69,6 +69,11 @@ export default function SettingsPage() {
|
|||||||
const [emailNotifications, setEmailNotifications] = useState(
|
const [emailNotifications, setEmailNotifications] = useState(
|
||||||
user?.email_notifications_enabled ?? true,
|
user?.email_notifications_enabled ?? true,
|
||||||
);
|
);
|
||||||
|
const [version, setVersion] = useState<string>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.electronApp.getVersion().then(setVersion);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleToggleEmailNotifications = async (checked: boolean) => {
|
const handleToggleEmailNotifications = async (checked: boolean) => {
|
||||||
setEmailNotifications(checked);
|
setEmailNotifications(checked);
|
||||||
@@ -122,21 +127,6 @@ export default function SettingsPage() {
|
|||||||
|
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|
||||||
<SettingsGroup title="Account">
|
|
||||||
<SettingsRow
|
|
||||||
icon={<User className="size-4" />}
|
|
||||||
label="Profile"
|
|
||||||
detail={user?.email_prefix}
|
|
||||||
/>
|
|
||||||
<Separator className="mx-4" />
|
|
||||||
<SettingsRow
|
|
||||||
icon={<Shield className="size-4" />}
|
|
||||||
label="Privacy"
|
|
||||||
/>
|
|
||||||
</SettingsGroup>
|
|
||||||
|
|
||||||
<Separator className="mt-4" />
|
|
||||||
|
|
||||||
<SettingsGroup title="Notifications">
|
<SettingsGroup title="Notifications">
|
||||||
<div className="flex w-full items-center gap-3 px-4 py-3">
|
<div className="flex w-full items-center gap-3 px-4 py-3">
|
||||||
<span className="text-muted-foreground flex size-5 items-center justify-center">
|
<span className="text-muted-foreground flex size-5 items-center justify-center">
|
||||||
@@ -169,7 +159,7 @@ export default function SettingsPage() {
|
|||||||
<SettingsRow
|
<SettingsRow
|
||||||
icon={<Info className="size-4" />}
|
icon={<Info className="size-4" />}
|
||||||
label="Version"
|
label="Version"
|
||||||
detail="1.0.0"
|
detail={version}
|
||||||
/>
|
/>
|
||||||
</SettingsGroup>
|
</SettingsGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -73,4 +73,5 @@ contextBridge.exposeInMainWorld('electronAttachment', {
|
|||||||
|
|
||||||
contextBridge.exposeInMainWorld('electronApp', {
|
contextBridge.exposeInMainWorld('electronApp', {
|
||||||
setDockBadge: (count: number) => ipcRenderer.send('app:set-dock-badge', count),
|
setDockBadge: (count: number) => ipcRenderer.send('app:set-dock-badge', count),
|
||||||
|
getVersion: () => ipcRenderer.invoke('app:get-version') as Promise<string>,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user