Skip to content

Commit 2ffb3a1

Browse files
authored
Pass the version in the updated param to attempt to cache bust (#21912)
1 parent 691b8d5 commit 2ffb3a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vector/platform/WebPlatform.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,18 @@ export default class WebPlatform extends VectorBasePlatform {
131131
console.log("startUpdater, current version is " + this.getNormalizedAppVersion(process.env.VERSION));
132132
this.pollForUpdate((version: string, newVersion: string) => {
133133
const query = parseQs(location);
134-
if (query.updated === "1") {
134+
if (query.updated) {
135135
console.log("Update reloaded but still on an old version, stopping");
136136
// We just reloaded already and are still on the old version!
137137
// Show the toast rather than reload in a loop.
138138
showUpdateToast(version, newVersion);
139139
return;
140140
}
141141

142-
// Set updated=1 as a query param so we can detect that we've already done this once
143-
// and reload the page.
142+
// Set updated as a cachebusting query param and reload the page.
144143
const url = new URL(window.location.href);
145-
url.searchParams.set("updated", "1");
144+
url.searchParams.set("updated", newVersion);
145+
console.log("Update reloading to " + url.toString());
146146
window.location.href = url.toString();
147147
});
148148
setInterval(() => this.pollForUpdate(showUpdateToast, hideUpdateToast), POKE_RATE_MS);

0 commit comments

Comments
 (0)