Build 576754stable
Module 343509
875 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>c});var i=n(228366),r=n(439372),a=n(927813),s=n(966597),l=n(85109);let o=null;class d extends r.A{actions={SAVED_MESSAGES_UPDATE:()=>this.handleUpdates(),SAVED_MESSAGE_CREATE:()=>this.handleUpdates(),SAVED_MESSAGE_DELETE:()=>this.handleUpdates()};handleUpdates=()=>{!function e(){let{enabled:t}=s.A.getConfig({location:"MessageRemindersNotificationManager"});if(!t)return;null!=o&&clearTimeout(o);let n=l.A.getMessageReminders().find(e=>null!=e.saveData.dueAt&&e.saveData.dueAt>new Date);if(n?.saveData?.dueAt==null){o=null;return}let r=Date.now()+a.A.Millis.WEEK;n.saveData.dueAt.getTime()>r||(o=setTimeout(()=>(function(t){let{enabled:n}=s.A.getConfig({location:"MessageRemindersNotificationManager"});n&&(i.h.dispatch({type:"MESSAGE_REMINDER_DUE",savedMessage:t}),e())})(n),n.saveData.dueAt.getTime()-Date.now()))}()}}let c=new d}