mirror of
https://github.com/mjl-/mox.git
synced 2025-01-27 14:55:56 +03:00
webmail: moxVersion was too similar to moxversion, choose better name
This commit is contained in:
parent
59bffa4701
commit
fce3a5bf73
2 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue