mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-09 22:54:18 +08:00
Cleanup time handling
This commit is contained in:
parent
bb15cd1ec3
commit
1f2208d304
3 changed files with 11 additions and 8 deletions
|
@ -81,6 +81,8 @@ import { ComposePopupView } from 'View/Popup/Compose';
|
||||||
import { FolderSystemPopupView } from 'View/Popup/FolderSystem';
|
import { FolderSystemPopupView } from 'View/Popup/FolderSystem';
|
||||||
import { AskPopupView } from 'View/Popup/Ask';
|
import { AskPopupView } from 'View/Popup/Ask';
|
||||||
|
|
||||||
|
import { timeToNode } from 'Common/Momentor';
|
||||||
|
|
||||||
// Every 5 minutes
|
// Every 5 minutes
|
||||||
const refreshFolders = 300000;
|
const refreshFolders = 300000;
|
||||||
|
|
||||||
|
@ -1020,7 +1022,14 @@ class AppUser extends AbstractApp {
|
||||||
this.hideLoading();
|
this.hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(() => dispatchEvent(new CustomEvent('reload-time')), 60000);
|
setInterval(this.reloadTime(), 60000);
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadTime()
|
||||||
|
{
|
||||||
|
setTimeout(() =>
|
||||||
|
doc.querySelectorAll('[data-bind*="moment:"]').forEach(element => timeToNode(element))
|
||||||
|
, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
showMessageComposer(params = [])
|
showMessageComposer(params = [])
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { doc } from 'Common/Globals';
|
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
export function timestampToString(timeStampInUTC, formatStr) {
|
export function timestampToString(timeStampInUTC, formatStr) {
|
||||||
|
@ -53,8 +52,3 @@ export function timeToNode(element, time) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addEventListener('reload-time', () => setTimeout(() =>
|
|
||||||
doc.querySelectorAll('[data-bind*="moment:"]').forEach(element => timeToNode(element))
|
|
||||||
, 1)
|
|
||||||
);
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ export function reload(admin, language) {
|
||||||
// reload the data
|
// reload the data
|
||||||
if (init()) {
|
if (init()) {
|
||||||
i18nToNodes(doc);
|
i18nToNodes(doc);
|
||||||
dispatchEvent(new CustomEvent('reload-time'));
|
admin || rl.app.reloadTime();
|
||||||
trigger(!trigger());
|
trigger(!trigger());
|
||||||
}
|
}
|
||||||
script.remove();
|
script.remove();
|
||||||
|
|
Loading…
Add table
Reference in a new issue