Add barebones UI version tracking

This commit is contained in:
2022-01-21 22:48:51 +00:00
parent 69126440d3
commit cf79c335c2
3 changed files with 14 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ import { PasswordReset, ConfirmReset } from './PasswordReset.js';
import { NotFound, PleaseLogin } from './Misc.js';
import { Footer } from './Footer.js';
const APP_VERSION = 1; // TODO: automate this
function App() {
const [token, setToken] = useState(localStorage.getItem('token', ''));
const [user, setUser] = useState(JSON.parse(localStorage.getItem('user', 'false')));
@@ -98,6 +100,11 @@ function App() {
darkmode.showWidget();
}, []);
if (user && user?.app_version !== APP_VERSION) {
setUserCache(false);
window.location.reload();
}
return (
<div>
<ManageScroll />