1 line
2.7 KiB
JavaScript
1 line
2.7 KiB
JavaScript
(function(s,v,f,n,e,b,u,x){"use strict";function F(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}function R(a,r,t){return r in a?Object.defineProperty(a,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[r]=t,a}const g=f.findByStoreName("UserStore"),{ScrollView:S,TouchableOpacity:d,Image:m,FlatList:I}=e.ReactNative,{FormInput:P,FormDivider:h,FormText:N,FormIcon:o,FormRow:p,FormSection:T}=x.Forms,y=e.stylesheet.createThemedStyleSheet({avatar:{height:36,width:36,borderRadius:18},button:{marginRight:12}});function _(a){let{callback:r}=a;return e.React.createElement(d,{onPress:r},e.React.createElement(N,{style:y.button},"ADD"))}function w(a){let{onFinish:r}=a;const[t,i]=e.React.useState(""),c=function(){t&&+t&&g.getUser(t)&&!n.storage.exempted.includes(t)&&(n.storage.exempted=[...n.storage.exempted,t],i("")),r()};return e.React.createElement(e.React.Fragment,null,e.React.createElement(h,null),e.React.createElement(p,{leading:e.React.createElement(o,{source:u.getAssetIDByName("ic_add_friend")}),label:e.React.createElement(P,{autoFocus:!0,title:"User ID",placeholder:"123456789012345678",value:t,keyboardType:"numeric",onChangeText:function(l){return i(l.replace(/[^0-9]/g,"").trim())},returnKeyType:"done"}),trailing:e.React.createElement(d,{onPress:c},e.React.createElement(o,{source:u.getAssetIDByName("ic_add_24px")}))}))}function U(){const[a,r]=e.React.useState(!1),t=b.useProxy(n.storage),i=e.NavigationNative.useNavigation();return e.React.useEffect(function(){i.setOptions({headerRight:function(){return e.React.createElement(_,{callback:function(){return r(!0)}})}})},[]),e.React.createElement(S,null,e.React.createElement(T,{title:"Exempted Users",titleStyleType:"no_border"},t.exempted?.length>0&&e.React.createElement(I,{data:t.exempted,keyExtractor:function(c){return c},renderItem:function(c){let{item:l}=c;const E=g.getUser(l);return e.React.createElement(p,{label:E.username,leading:e.React.createElement(m,{style:y.avatar,source:{uri:E.getAvatarURL()}}),trailing:e.React.createElement(d,{onPress:function(){n.storage.exempted=n.storage.exempted.filter(function(C){return C!==l})}},e.React.createElement(o,{source:u.getAssetIDByName("Small"),disableColor:!0}))})},ItemSeparatorComponent:h}),a&&e.React.createElement(w,{onFinish:function(){return r(!1)}})))}const D=f.findByProps("createPendingReply");n.storage.exempted??=[];var A=new function a(){F(this,a),R(this,"settings",U),R(this,"onUnload",v.patcher.before("createPendingReply",D,function(r){let[t]=r;t.shouldMention&&=n.storage.exempted.includes(t.message?.author?.id)}))};return s.default=A,Object.defineProperty(s,"__esModule",{value:!0}),s})({},vendetta,vendetta.metro,vendetta.plugin,vendetta.metro.common,vendetta.storage,vendetta.ui.assets,vendetta.ui.components);
|