Skip to content

Commit

Permalink
Fix cache/setting overwrite. Goodbye Glimesh!
Browse files Browse the repository at this point in the history
  • Loading branch information
aMytho committed Jun 6, 2023
1 parent 0e92577 commit c4350d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 5 additions & 3 deletions lib/frontend/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,13 @@ function importData() {

function useNewURL() {
let newURL = (document.getElementById("newServerURL") as HTMLInputElement).value.trim();
CacheStore.set("glimeshURL", newURL);
let useHTTPS = (document.getElementById("useHttps") as HTMLInputElement).checked;
CacheStore.set("useGlimeshHTTPS", useHTTPS);
let newClientID = (document.getElementById("newClientID") as HTMLInputElement).value.trim();
CacheStore.set("glimeshClientID", newClientID);
CacheStore.setMultiple([
{glimeshURL: newURL},
{useHTTPS: useHTTPS},
{glimeshClientID: newClientID}
]);
showToast("Server updated. Good luck with your new platform!");
}

Expand Down
11 changes: 5 additions & 6 deletions lib/modules/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,11 @@ function checkForHoldOnAMinCommaCriesCommaTheFinalUpdate() {
if (!knowsAboutTheEnd) {
// But now the end has come..

// Set the new URL
CacheStore.set("glimeshURL", "glimesh.tv");
CacheStore.set("useGlimeshHTTPS", true);
// There is also a new client ID, but every use has the default value
// Don't run this function again
CacheStore.set("setFinalURL", true);
CacheStore.setMultiple([
{glimeshURL: "glimesh.tv"},
{useGlimeshHTTPS: true},
{setFinalURL: true}
]); // Sets all the values for custom servers. Defaults to glimesh.tv

// My glimboi dev is now done...
}
Expand Down

0 comments on commit c4350d5

Please sign in to comment.