Add a hack to have some sort of cache management as well for .ms files, to avoid stupid issue where people need to force the browser cache refresh after upgrades

This commit is contained in:
Alexandre Aubin 2020-06-30 02:22:19 +02:00
parent f769b45c11
commit 7bb8a908b9

View file

@ -1,4 +1,10 @@
(function() { (function() {
// This is to fetch the "RANDOMID" after script.min.js?version= in
// index.html
// We later use the same ID as a hacky cache mechanism for the .ms files
var ynh_assets_version = document.getElementsByTagName('script')[0].src.split("=")[1];
// Get application context // Get application context
var app = Sammy.apps['#main']; var app = Sammy.apps['#main'];
var store = app.store; var store = app.store;
@ -319,7 +325,7 @@
$('#modal').modal('hide'); $('#modal').modal('hide');
// Render content // Render content
var rendered = this.render('views/'+ view +'.ms', data); var rendered = this.render('views/' + view + '.ms?version=' + ynh_assets_version, data);
// Update content helper // Update content helper
var leSwap = function() { var leSwap = function() {