Version check

This commit is contained in:
SillyLossy
2023-03-19 21:10:30 +02:00
parent 54b0628631
commit 296deba415
2 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ export {
// API OBJECT FOR EXTERNAL WIRING // API OBJECT FOR EXTERNAL WIRING
window["TavernAI"] = {}; window["TavernAI"] = {};
const VERSION = "1.2.8"; const VERSION = "1.1.0";
let converter = new showdown.Converter({ emoji: "true" }); let converter = new showdown.Converter({ emoji: "true" });
let bg_menu_toggle = false; let bg_menu_toggle = false;
const systemUserName = "TavernAI"; const systemUserName = "TavernAI";

View File

@ -198,7 +198,7 @@ app.get("/notes/*", function (request, response) {
app.post("/getlastversion", jsonParser, function (request, response_getlastversion = response) { app.post("/getlastversion", jsonParser, function (request, response_getlastversion = response) {
if (!request.body) return response_getlastversion.sendStatus(400); if (!request.body) return response_getlastversion.sendStatus(400);
const repo = 'TavernAI/TavernAI'; const repo = 'SillyLossy/TavernAI';
let req; let req;
req = https.request({ req = https.request({
hostname: 'github.com', hostname: 'github.com',
@ -207,7 +207,7 @@ app.post("/getlastversion", jsonParser, function (request, response_getlastversi
}, (res) => { }, (res) => {
if (res.statusCode === 302) { if (res.statusCode === 302) {
const glocation = res.headers.location; const glocation = res.headers.location;
const versionStartIndex = glocation.lastIndexOf('@') + 1; const versionStartIndex = glocation.lastIndexOf('/tag/') + 5;
const version = glocation.substring(versionStartIndex); const version = glocation.substring(versionStartIndex);
//console.log(version); //console.log(version);
response_getlastversion.send({ version: version }); response_getlastversion.send({ version: version });