Reload when the API version changes

pull/1/head
yflory 5 years ago
parent 0074824a0a
commit cdcc52224a

@ -1712,9 +1712,9 @@ define([
var stored = currentVersion || '0.0.0'; var stored = currentVersion || '0.0.0';
var storedArr = stored.split('.'); var storedArr = stored.split('.');
storedArr[2] = 0; storedArr[2] = 0;
var shouldUpdate = parseInt(verArr[0]) > parseInt(storedArr[0]) || var shouldUpdate = parseInt(verArr[0]) !== parseInt(storedArr[0]) ||
(parseInt(verArr[0]) === parseInt(storedArr[0]) && (parseInt(verArr[0]) === parseInt(storedArr[0]) &&
parseInt(verArr[1]) > parseInt(storedArr[1])); parseInt(verArr[1]) !== parseInt(storedArr[1]));
if (!shouldUpdate) { return; } if (!shouldUpdate) { return; }
currentVersion = ver; currentVersion = ver;
localStorage[CRYPTPAD_VERSION] = ver; localStorage[CRYPTPAD_VERSION] = ver;

Loading…
Cancel
Save