Module 327866

1,324 characters · in 30a277b9d32d70b1.js
Dependencies
Required by (1)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{A:()=>C});var i=n(64700),l=n(311907),a=n(827343),r=n(800828),s=n(912309),o=n(780964),d=n(858897),c=n(458294),u=n(430452),A=n(803224),h=n(383501),_=n(994500),m=n(485296),g=n(723702),p=n(837921);let E=(0,g.isMac)()?null:"DEFAULT";class I extends i.PureComponent{getIcon=()=>{let{deafened:e,muted:t,speaking:n,connected:i,unread:l}=this.props,a=E;return(0,g.isMac)()&&!i?a:(0,g.isLinux)()||!i?(l&&(a="UNREAD"),a):a=e?"DEAFENED":t?"MUTED":n?"SPEAKING":"CONNECTED"};componentDidMount(){p.Ay.setSystemTrayIcon(this.getIcon())}componentDidUpdate(){p.Ay.setSystemTrayIcon(this.getIcon())}componentWillUnmount(){p.Ay.setSystemTrayIcon(E)}render(){return null}}let f=()=>null;g.isPlatformEmbedded&&(p.Ay.on("SYSTEM_TRAY_TOGGLE_MUTE",()=>a.A.toggleSelfMute({location:"System Tray"})),p.Ay.on("SYSTEM_TRAY_TOGGLE_DEAFEN",()=>a.A.toggleSelfDeaf()),p.Ay.on("SYSTEM_TRAY_OPEN_VOICE_SETTINGS",()=>{(0,d.openUserSettings)(o.X.VOICE_CATEGORY)}),f=l.Ay.connectStores([h.A,u.Ay,m.A,c.default,_.A,A.A,r.A],()=>{let e=c.default.getTotalMentionCount(),t=c.default.hasAnyUnread(),n=(0,s.dH)([_.A,r.A]),i=!A.A.getDisableUnreadBadge()&&!!(t||e+n>0);return{connected:h.A.isConnected(),speaking:m.A.isCurrentUserSpeaking(),muted:u.Ay.isSelfMute()||u.Ay.isSelfMutedTemporarily(),deafened:u.Ay.isSelfDeaf(),unread:i}})(I));let C=f}