Repository navigation
Expand file tree
/
Copy pathaddGroupToCommunity-CK1oGUz0.js
More file actions
3 lines (3 loc) · 2.49 KB
/
Copy pathaddGroupToCommunity-CK1oGUz0.js
File metadata and controls
3 lines (3 loc) · 2.49 KB
1
2
3
//# allFunctionsCalledOnLoad
import{t as e,u as t}from"./apiManagerProxy-BsT2jiCe.js";import{a as n}from"./langPack-Cx34d7Qs.js";import{f as r,s as i,v as a}from"./solid-Beq2bZCx.js";import{c as o,h as s,l as c,o as l}from"./web-BIda0ujS.js";import{n as u}from"./hotReloadGuardProvider-M_nRCQzG.js";import{i as d}from"./confirmationPopup-Dcep-P6V.js";import{i as f,t as p}from"./mediaHeader-BscsyAc7.js";import{a as m}from"./emailVerification-BSPYl-u5.js";import{n as h}from"./superTabProvider-wAINAt5O.js";import{t as g}from"./communityAvatar-BUM6-rnk.js";import{t as _}from"./communityShared.module-DZR6dAg9.js";import"./communityShared-C0AyraE3.js";import{t as v}from"./communityPeerDialogList-Dy08mv3X.js";var y=s(`<div>`);function b(){let[s]=h(),b=f(),x=t(),{peerId:S}=s.payload,C=e.getPeer(S),w=C?._===`user`&&C.pFlags.bot?`Community.AddBot`:C?._===`channel`&&C.pFlags.broadcast?`Community.AddChannel`:`Community.AddGroup`,T=C?._===`user`&&C.pFlags.bot?`Community.BotDescription`:C?._===`channel`&&C.pFlags.broadcast?`Community.ChannelDescription`:`Community.Description`,E=n(`Community.Title`).textContent;s.title.replaceChildren(n(w));let D=s.managers.appCommunitiesManager.getJoinedCommunities();b.collect(D),D.then(()=>{x()?.forEach(e=>{Promise.resolve(s.managers.appProfileManager.getChatFull(e.id.toChatId())).catch(()=>void 0)})},()=>void 0);let O=()=>{s.slider.createTab(u.tabs.AppCreateCommunityTab).open({peerId:S})},k=e=>{s.slider.createTab(u.tabs.AppCommunityChatSettingsTab).open({communityId:e,peerId:S,mode:`add`,initialVisibility:`visible`,returnToEditChat:!0})};return(()=>{var e=y();return o(e,r(p,{marginBottom:!0,get children(){return[r(p.Sticker,{size:90,get element(){return r(g,{peerId:S,title:E,size:90})}}),r(p.Title,{children:E}),r(p.Subtitle,{color:`secondary`,get children(){return n(T)}})]}}),null),o(e,r(m,{get children(){return r(d,{clickable:O,role:`button`,tabIndex:0,"on:keydown":e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},get children(){return[r(d.Icon,{icon:`newgroup_filled`}),r(d.Title,{get children(){return n(`Community.Create`)}})]}})}}),null),o(e,r(m,{name:`Community.AddExisting`,get children(){return[r(v,{get communities(){return x()||[]},get middleware(){return s.middlewareHelper.get()},onClick:e=>{k(e.id.toChatId())}}),r(i,{get when(){return c(()=>!!x())()&&!x().length},get children(){var e=y();return o(e,()=>n(`Community.NoCommunities`)),a(()=>l(e,_.empty)),e}})]}}),null),e})()}export{b as default};
//# sourceMappingURL=addGroupToCommunity-CK1oGUz0.js.map