Skip to content

Commit

Permalink
Fix: Use build.timestamp to force json reload
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster committed Feb 5, 2025
1 parent 2f7f5a7 commit f893e97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Data extends AdaptCollection {
async init () {
this.reset();
this._byAdaptID = {};
Adapt.build = new BuildModel(null, { url: 'adapt/js/build.min.js', reset: true });
Adapt.build = new BuildModel(null, { url: `adapt/js/build.min.js?timestamp=${Date.now()}`, reset: true });
await Adapt.build.whenReady();
$('html').attr('data-adapt-framework-version', Adapt.build.get('package').version);
this.loadConfigData();
Expand All @@ -49,7 +49,7 @@ class Data extends AdaptCollection {
}

loadConfigData() {
Adapt.config = new ConfigModel(null, { url: Adapt.build.get('coursedir') + '/config.' + Adapt.build.get('jsonext'), reset: true });
Adapt.config = new ConfigModel(null, { url: Adapt.build.get('coursedir') + '/config.' + Adapt.build.get('jsonext') + `?timestamp=${Adapt.build.get('timestamp')}`, reset: true });
this.listenToOnce(Adapt, 'configModel:loadCourseData', this.onLoadCourseData);
this.listenTo(Adapt.config, {
'change:_activeLanguage': this.onLanguageChange,
Expand Down Expand Up @@ -134,7 +134,7 @@ class Data extends AdaptCollection {
let allFileData;
try {
allFileData = await Promise.all(manifest.map(filePath => {
return this.getJSON(`${languagePath}${filePath}`);
return this.getJSON(`${languagePath}${filePath}?timestamp=${Adapt.build.get('timestamp')}`);
}));
} catch (error) {
logging.error(error);
Expand Down

0 comments on commit f893e97

Please sign in to comment.