1 line
1.9 KiB
JavaScript
1 line
1.9 KiB
JavaScript
(function(s,d,t,v,a){"use strict";const o=t.findByProps("useStateFromStores"),{Pressable:B,View:l}=v.ReactNative,i=t.find(function(e){return e?.type?.displayName==="ChatInputActions"})||t.findByName("ChatInputActions"),f=t.findByProps("default","AvatarSizes","getStatusSize")?.default||t.findByProps("getStatusSize")?.default||t.findByName("Avatar"),S=t.findByStoreName("UserStore"),y=t.findByStoreName("SelectedChannelStore"),h=t.findByStoreName("ChannelStore"),m=t.findByStoreName("SelfPresenceStore"),g=t.findByName("showUserProfileActionSheet"),I=t.findByProps("showYouAccountActionSheet");function P(e,n){const r=I?.showYouAccountActionSheet;if(typeof r=="function")try{r(!0,!0);return}catch{}g?.({userId:e,channelId:n})}function p(){const e=o?.useStateFromStores?.([S],function(){return S?.getCurrentUser?.()}),n=o?.useStateFromStores?.([m],function(){return m?.getStatus?.()}),r=o?.useStateFromStores?.([y],function(){return y?.getCurrentlySelectedChannelId?.()}),c=o?.useStateFromStores?.([h],function(){return h?.getChannel?.(r)},[r]);return!e||!f?null:a.createElement(B,{onPress:function(){return g?.({userId:e.id,channelId:c?.id??r})},onLongPress:function(){return P(e.id,c?.id??r)},style:{justifyContent:"center",alignItems:"center",marginHorizontal:4}},a.createElement(f,{user:e,guildId:c?.guild_id,status:n,avatarDecoration:e?.avatarDecoration,animate:!0}))}const u=[];var A={onLoad(){i&&(i.type?u.push(d.after("render",i.type,function(e,n){return a.createElement(l,{style:{flexDirection:"row",alignItems:"center"}},n,a.createElement(p,null))})):u.push(d.after("render",i,function(e,n){return a.createElement(l,{style:{flexDirection:"row",alignItems:"center"}},n,a.createElement(p,null))})))},onUnload(){for(const e of u)e?.();u.length=0}};return s.default=A,Object.defineProperty(s,"__esModule",{value:!0}),s})({},vendetta.patcher,vendetta.metro,vendetta.metro.common,window.React);
|