Stop ads when leaving a channel
This commit is contained in:
		
							parent
							
								
									b42a1417b0
								
							
						
					
					
						commit
						acfd2bf9cf
					
				@ -641,6 +641,14 @@ export default function(this: any): Interfaces.State {
 | 
			
		||||
        queuedJoin(state.pinned.channels.slice());
 | 
			
		||||
    });
 | 
			
		||||
    core.channels.onEvent(async(type, channel, member) => {
 | 
			
		||||
        if (type === 'leave') {
 | 
			
		||||
            const conv = state.channelMap[channel.id];
 | 
			
		||||
 | 
			
		||||
            if (conv) {
 | 
			
		||||
                conv.adManager.stop();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(type === 'join')
 | 
			
		||||
            if(member === undefined) {
 | 
			
		||||
                const conv = new ChannelConversation(channel);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user