Minor cleanup and add sentry.

This commit is contained in:
Patrick Fic
2025-03-31 13:03:31 -07:00
parent 38cdb1e04c
commit eeaeba2252
12 changed files with 3921 additions and 131 deletions

View File

@@ -100,13 +100,16 @@ const SettingsWatcher: React.FC = () => {
checkedChildren={t("settings.labels.watchermoderealtime")}
unCheckedChildren={t("settings.labels.watchermodepolling")}
/>
<InputNumber
title={t("settings.labels.pollinginterval")}
disabled={!pollingState.enabled}
min={1000}
value={pollingState.interval}
onChange={handlePollingIntervalChange}
/>
<Space size="small">
<span>{t("settings.labels.pollinginterval")}</span>
<InputNumber
title={t("settings.labels.pollinginterval")}
disabled={!pollingState.enabled}
min={1000}
value={pollingState.interval}
onChange={handlePollingIntervalChange}
/>
</Space>
{watcherError && <Alert message={watcherError} />}
</Space>
</Card>

View File

@@ -1,10 +1,14 @@
import { Col, Row } from "antd";
import SettingsWatchedPaths from "./Settings.WatchedPaths";
import SettingsWatcher from "./Settings.Watcher";
import Welcome from "../Welcome/Welcome";
const Settings: React.FC = () => {
return (
<Row gutter={[32, 32]}>
<Col span={24}>
<Welcome />
</Col>
<Col span={24}>
<SettingsWatchedPaths />
</Col>

View File

@@ -0,0 +1,31 @@
import { auth } from "@renderer/util/firebase";
import { Card, Typography } from "antd";
import { JSX, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import ipcTypes from "../../../../util/ipcTypes.json";
const Welcome = (): JSX.Element => {
const { t } = useTranslation();
const [shopName, setShopName] = useState<string | null>(null);
useEffect(() => {
window.electron.ipcRenderer
.invoke(ipcTypes.toMain.user.getActiveShop)
.then((shopName: string) => {
console.log("Active shop name:", shopName);
setShopName(shopName);
});
}, []);
return (
<>
<Card>
<Typography.Title level={3}>
{t("auth.labels.welcome", { name: auth.currentUser?.displayName })}
</Typography.Title>
<Typography.Paragraph>{shopName || ""}</Typography.Paragraph>
</Card>
</>
);
};
export default Welcome;

View File

@@ -3,6 +3,11 @@ import ReactDOM from "react-dom/client";
import App from "./App";
import "./util/i18n";
import "./util/ipcRendererHandler";
import * as Sentry from "@sentry/electron/renderer";
Sentry.init({
dsn: "https://ba41d22656999a8c1fd63bcb7df98650@o492140.ingest.us.sentry.io/4509074139447296",
});
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>