Module 353202

1,055 characters · in no known chunk
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>g});var r=n(562465),i=n(73153),s=n(695870),a=n(142120),o=n(463347),l=n(334465),u=n(95701),c=n(734057),d=n(309010),_=n(652215),f=n(746080);let p={},h=!1;function m(){h||(h=!0,i.h.subscribe("CONNECTION_OPEN",()=>{p={};let e=d.A.getChannelId(),t=c.A.getChannel(e);null!=e&&null==t&&E(e)}))}function E(e){if(null==e||e===s.E||(0,f.jq)(e)||null!=c.A.getChannel(e)||(m(),!a.A.isConnected()))return Promise.resolve();let t=p[e];if(null!=t)if("LOADING"===t.type)return t.promise;else return Promise.resolve();let n=(0,l.B)(location.pathname,{path:_.BVt.CHANNEL(o.pv.guildId(),o.pv.channelId(),":messageId"),exact:!0}),d=r.Bo.get({url:_.Rsh.CHANNEL(e),rejectWithError:!1}).then(t=>{let{body:r}=t;p[e]={type:"LOADED"},u.Le.has(r.type)&&i.h.dispatch({type:"THREAD_CREATE",channel:(0,u.UE)(r),messageId:n?.params?.messageId})}).catch(()=>{p[e]={type:"NOT_FOUND"},i.h.dispatch({type:"CHANNEL_DELETE",channel:{id:e,guild_id:n?.params?.guildId,parent_id:void 0}})});return p[e]={type:"LOADING",promise:d},d}let g={loadThread:E}}