diff --git a/.vscode/settings.json b/.vscode/settings.json index e73292f..89c7c47 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -53,6 +53,7 @@ "multiline", "optimisation", "personalise", + "pkgbuild", "pnpm", "precaching", "privatekeys", diff --git a/craco.config.js b/craco.config.js index 16d66cf..5a008c9 100644 --- a/craco.config.js +++ b/craco.config.js @@ -84,7 +84,8 @@ "__GIT_VERSION__": DefinePlugin.runtimeValue(() => JSON.stringify(gitRevisionPlugin.version()), []), "__GIT_COMMIT_HASH__": DefinePlugin.runtimeValue(() => JSON.stringify(gitRevisionPlugin.commithash()), []), "__BUILD_TIME__": DefinePlugin.runtimeValue(Date.now), - "__GIT_COMMITS__": JSON.stringify(commits) + "__GIT_COMMITS__": JSON.stringify(commits), + "__PKGBUILD__": DefinePlugin.runtimeValue(() => JSON.stringify(require("crypto").createHash("sha256").update(require("fs").readFileSync("package.json")).digest("hex").substr(0, 7)), ["package.json"]) }) ], diff --git a/public/locales/en.json b/public/locales/en.json index fd493b8..b93f258 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -385,7 +385,9 @@ "versionInfo": { "version": "Version", "commitHash": "Commit", - "buildTime": "Build time" + "buildTime": "Build time", + "variant": "Build variant", + "license": "License" } }, diff --git a/src/layout/nav/CymbalIndicator.tsx b/src/layout/nav/CymbalIndicator.tsx index d4e0483..4b47590 100644 --- a/src/layout/nav/CymbalIndicator.tsx +++ b/src/layout/nav/CymbalIndicator.tsx @@ -1,9 +1,12 @@ // Copyright (c) 2020-2021 Drew Lemmy // This file is part of KristWeb 2 under AGPL-3.0. // Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt +import { useMemo } from "react"; import { Typography } from "antd"; import Icon from "@ant-design/icons"; +import packageJson from "../../../package.json"; + import { useSelector, shallowEqual } from "react-redux"; import { RootState } from "@store"; import { SettingsState } from "@utils/settings"; @@ -23,12 +26,14 @@ export function CymbalIndicator(): JSX.Element | null { const allSettings: SettingsState = useSelector((s: RootState) => s.settings, shallowEqual); const { addressList } = useWallets(); + const serverChanged = useMemo(() => localStorage.getItem("syncNode") !== packageJson.defaultSyncNode, []); const on = allSettings.walletFormats - || addressList.length > ADDRESS_LIST_LIMIT; + || addressList.length > ADDRESS_LIST_LIMIT + || serverChanged; return on ?