Add barebones UI version tracking
This commit is contained in:
@@ -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 />
|
||||
|
Reference in New Issue
Block a user