fix check

This commit is contained in:
Fernando Campione
2026-01-09 10:10:16 +00:00
parent 6ec66ada33
commit 0f08522e56
4 changed files with 18 additions and 9 deletions
+1 -1
View File
@@ -30,7 +30,7 @@
<script src="/js/commands.js"></script>
<script src="/js/version-checker.js"></script>
</head>
<body>
<body data-version="{{VERSION}}">
<div id="version-notification" class="version-notification">
<div class="version-content">
<span class="version-text">New version available!</span>
+5 -2
View File
@@ -1,6 +1,9 @@
const CACHE_KEY = "hypermind-version-check";
const CACHE_DURATION = 86400000;
const CURRENT_VERSION = "1.0.0";
const getCurrentVersion = () => {
return document.body.dataset.version || "no-version";
};
const checkForNewVersion = async () => {
try {
@@ -42,7 +45,7 @@ const showVersionNotification = (release) => {
if (!release || !release.tag_name) return;
const latestVersion = release.tag_name.replace(/^v/, "");
const currentVersion = CURRENT_VERSION;
const currentVersion = getCurrentVersion();
if (latestVersion === currentVersion) return;
+9 -4
View File
@@ -47,10 +47,14 @@ const GENERATOR_LOGIC = fs.readFileSync(
"utf-8"
);
const GITHUB_REPO = {
owner: "lklynet",
name: "hypermind",
};
const packageJson = require("../../package.json");
const repoUrl = packageJson.repository?.url || "";
const repoMatch = repoUrl.match(/github\.com\/([^\/]+)\/([^\/\.]+)/);
const GITHUB_REPO = repoMatch
? { owner: repoMatch[1], name: repoMatch[2] }
: { owner: "lklynet|test", name: "hypermind|test" };
const VERSION = packageJson.version || "no-version";
module.exports = {
TOPIC_NAME,
@@ -77,4 +81,5 @@ module.exports = {
NOUNS,
GENERATOR_LOGIC,
GITHUB_REPO,
VERSION,
};
+3 -2
View File
@@ -1,4 +1,4 @@
const { ENABLE_MAP, ENABLE_THEMES, VISUAL_LIMIT } = require("../../config/constants");
const { ENABLE_MAP, ENABLE_THEMES, VISUAL_LIMIT, VERSION } = require("../../config/constants");
const setupPageRoutes = (router, dependencies) => {
const { htmlTemplate, identity, peerManager, swarm } = dependencies;
@@ -16,7 +16,8 @@ const setupPageRoutes = (router, dependencies) => {
.replace(/\{\{TOTAL_UNIQUE\}\}/g, totalUnique)
.replace(/\{\{MAP_CLASS\}\}/g, ENABLE_MAP ? "" : "hidden")
.replace(/\{\{THEMES_CLASS\}\}/g, ENABLE_THEMES ? "" : "hidden")
.replace(/\{\{VISUAL_LIMIT\}\}/g, VISUAL_LIMIT);
.replace(/\{\{VISUAL_LIMIT\}\}/g, VISUAL_LIMIT)
.replace(/\{\{VERSION\}\}/g, VERSION);
res.send(html);
});