Merge pull request #963 from benphelps/fix-settings-after-container-update

Fix settings after container update
This commit is contained in:
Jason Fischer 2023-02-18 22:56:53 -08:00 committed by GitHub
commit 45946ddfe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 18 deletions

View file

@ -19,7 +19,10 @@ export default async function handler(req, res) {
return hash(readFileSync(configYaml, "utf8"));
});
const combinedHash = hash(hashes.join(""));
// this ties hash to specific build which should force revaliation between versions
const buildTime = process.env.NEXT_PUBLIC_BUILDTIME?.length ? process.env.NEXT_PUBLIC_BUILDTIME : '';
const combinedHash = hash(hashes.join("") + buildTime);
res.send({
hash: combinedHash,

View file

@ -100,7 +100,7 @@ function Index({ initialSettings, fallback }) {
localStorage.setItem("hash", hashData.hash);
}
if (!initialSettings.isValid || (previousHash && previousHash !== hashData.hash)) {
if (previousHash && previousHash !== hashData.hash) {
setStale(true);
localStorage.setItem("hash", hashData.hash);
@ -112,7 +112,7 @@ function Index({ initialSettings, fallback }) {
}
}
}
}, [hashData, initialSettings]);
}, [hashData]);
if (stale) {
return (