diff --git a/js/expire.js b/js/expire.js index ba200c41e..e76c64acf 100644 --- a/js/expire.js +++ b/js/expire.js @@ -124,7 +124,7 @@ }; // require for PoW to work - const setClockParams = async () => { + window.setClockParams = async () => { // Set server-client time difference const maxTimeDifferential = 30 + 15; // + 15 for onion requests const timeDifferential = await getTimeDifferential(); @@ -133,5 +133,5 @@ window.clientClockSynced = Math.abs(timeDifferential) < maxTimeDifferential; return window.clientClockSynced; }; - setClockParams(); + window.setClockParams(); })(); diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index f6560102f..fbef3eb08 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -1914,8 +1914,13 @@ toastOptions.id = 'expiredWarning'; } if (!window.clientClockSynced) { - // Check to see if user has updated their clock to current time - const clockSynced = await window.LokiPublicChatAPI.setClockParams(); + let clockSynced = false; + if (window.setClockParams) { + // Check to see if user has updated their clock to current time + clockSynced = await window.setClockParams(); + } else { + window.log.info('setClockParams not loaded yet'); + } if (clockSynced) { toastOptions.title = i18n('clockOutOfSync'); toastOptions.id = 'clockOutOfSync';