Focus tab of Mastodon when clicking notification (#2989)
This commit is contained in:
		
							parent
							
								
									61edc8e98d
								
							
						
					
					
						commit
						08f861bbc5
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -50,7 +50,11 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
 | 
			
		|||
      const title = new IntlMessageFormat(intlMessages[`notification.${notification.type}`], intlLocale).format({ name: notification.account.display_name.length > 0 ? notification.account.display_name : notification.account.username });
 | 
			
		||||
      const body  = (notification.status && notification.status.spoiler_text.length > 0) ? unescapeHTML(notification.status.spoiler_text) : unescapeHTML(notification.status ? notification.status.content : '');
 | 
			
		||||
 | 
			
		||||
      new Notification(title, { body, icon: notification.account.avatar, tag: notification.id });
 | 
			
		||||
      const notify = new Notification(title, { body, icon: notification.account.avatar, tag: notification.id });
 | 
			
		||||
      notify.addEventListener('click', () => {
 | 
			
		||||
        window.focus();
 | 
			
		||||
        notify.close();
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue