mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-12-03 12:49:30 +00:00
Cachebust languages.json (#34705)
* Cachebust languages.json To avoid loading stale language files. The individual language files as hashbusted but the metadata file is not, and it is not feasible to do so. * Switch cachebust to use Date.now to further avoid collisions * Fix tests * Fix tests
This commit is contained in:
committed by
GitHub
parent
bfd2d16fa6
commit
ceaa3ff74e
@@ -433,7 +433,8 @@ async function getLanguage(langPath: string): Promise<ICounterpartTranslation> {
|
||||
}
|
||||
|
||||
export async function getLangsJson(): Promise<Languages> {
|
||||
const url = i18nFolder + "languages.json";
|
||||
const cachebust = Date.now();
|
||||
const url = `${i18nFolder}languages.json?${cachebust}`;
|
||||
|
||||
const res = await fetch(url, { method: "GET" });
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ expect.addSnapshotSerializer({
|
||||
|
||||
function setupLanguageMock(): void {
|
||||
fetchMock
|
||||
.get("end:/i18n/languages.json", {
|
||||
.get("include:/i18n/languages.json?", {
|
||||
en: "en_EN.json",
|
||||
})
|
||||
.get("end:en_EN.json", en);
|
||||
|
||||
Reference in New Issue
Block a user