Skip to content

New: Use build.timestamp to force json reload #622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading