diff --git a/apps/main/src/tipc/app.ts b/apps/main/src/tipc/app.ts index 564214c76..1dd75869b 100644 --- a/apps/main/src/tipc/app.ts +++ b/apps/main/src/tipc/app.ts @@ -6,7 +6,6 @@ import { fileURLToPath } from "node:url" import { getRendererHandlers } from "@egoist/tipc/main" import { callWindowExpose } from "@follow/shared/bridge" -import pkg from "@pkg" import { app, BrowserWindow, clipboard, dialog, screen, shell } from "electron" import { registerMenuAndContextMenu } from "~/init" @@ -14,11 +13,7 @@ import { clearAllData, getCacheSize } from "~/lib/cleaner" import { store, StoreKey } from "~/lib/store" import { registerAppTray } from "~/lib/tray" import { logger, revealLogFile } from "~/logger" -import { - cleanupOldRender, - getCurrentRenderManifest, - loadDynamicRenderEntry, -} from "~/updater/hot-updater" +import { cleanupOldRender, loadDynamicRenderEntry } from "~/updater/hot-updater" import { isDev, isWindows11 } from "../env" import { downloadFile } from "../lib/download" @@ -279,9 +274,8 @@ ${content} } }), - getRenderVersion: t.procedure.action(async () => { - const manifest = getCurrentRenderManifest() - return manifest?.version || pkg.version + getAppVersion: t.procedure.action(async () => { + return app.getVersion() }), rendererUpdateReload: t.procedure.action(async () => { const __dirname = fileURLToPath(new URL(".", import.meta.url)) diff --git a/apps/renderer/src/modules/settings/tabs/about.tsx b/apps/renderer/src/modules/settings/tabs/about.tsx index 12db98562..4382bf319 100644 --- a/apps/renderer/src/modules/settings/tabs/about.tsx +++ b/apps/renderer/src/modules/settings/tabs/about.tsx @@ -3,7 +3,7 @@ import { Button } from "@follow/components/ui/button/index.js" import { styledButtonVariant } from "@follow/components/ui/button/variants.js" import { Divider } from "@follow/components/ui/divider/index.js" import { getCurrentEnvironment } from "@follow/utils/environment" -import { license, repository } from "@pkg" +import PKG, { license, repository } from "@pkg" import { useQuery } from "@tanstack/react-query" import { Trans, useTranslation } from "react-i18next" @@ -15,11 +15,13 @@ import { getNewIssueUrl } from "~/lib/issues" export const SettingAbout = () => { const { t } = useTranslation("settings") const currentEnvironment = getCurrentEnvironment().join("\n") - const { data: renderVersion } = useQuery({ - queryKey: ["renderVersion"], - queryFn: () => tipcClient?.getRenderVersion() || "", + const { data: appVersion } = useQuery({ + queryKey: ["appVersion"], + queryFn: () => tipcClient?.getAppVersion() || "", }) + const rendererVersion = PKG.version + return (
@@ -31,16 +33,16 @@ export const SettingAbout = () => { {APP_NAME} {!import.meta.env.PROD ? `(${import.meta.env.MODE})` : ""}
- app: {APP_VERSION} - {renderVersion && ( + app: {appVersion} + {rendererVersion && ( - renderer: {renderVersion} + renderer: {rendererVersion} )}