webmail: moxVersion was too similar to moxversion, choose better name

This commit is contained in:
Mechiel Lukkien 2024-01-01 14:51:17 +01:00
parent 59bffa4701
commit fce3a5bf73
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -1291,7 +1291,7 @@ let domainAddressConfigs = {};
// Mailbox containing rejects.
let rejectsMailbox = '';
// Last known server version. For asking to reload.
let moxVersion = '';
let lastServerVersion = '';
const client = new api.Client();
// Link returns a clickable link with rel="noopener noreferrer".
const link = (href, anchorOpt) => dom.a(attr.href(href), attr.rel('noopener noreferrer'), attr.target('_blank'), anchorOpt || href);
@ -6017,13 +6017,13 @@ const init = async () => {
};
eventSource.addEventListener('start', (e) => {
const data = JSON.parse(e.data);
if (moxVersion && data.Version !== moxVersion) {
if (lastServerVersion && data.Version !== lastServerVersion) {
if (window.confirm('Server has been updated to a new version. Reload?')) {
window.location.reload();
return;
}
}
moxVersion = data.Version;
lastServerVersion = data.Version;
const start = checkParse(() => api.parser.EventStart(data));
log('event start', start);
connecting = false;

View file

@ -228,7 +228,7 @@ let domainAddressConfigs: {[domainASCII: string]: api.DomainAddressConfig} = {}
let rejectsMailbox: string = ''
// Last known server version. For asking to reload.
let moxVersion: string = ''
let lastServerVersion: string = ''
const client = new api.Client()
@ -6340,13 +6340,13 @@ const init = async () => {
eventSource.addEventListener('start', (e: MessageEvent) => {
const data = JSON.parse(e.data)
if (moxVersion && data.Version !== moxVersion) {
if (lastServerVersion && data.Version !== lastServerVersion) {
if (window.confirm('Server has been updated to a new version. Reload?')) {
window.location.reload()
return
}
}
moxVersion = data.Version
lastServerVersion = data.Version
const start = checkParse(() => api.parser.EventStart(data))
log('event start', start)