mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Close EventSource before unloading the page (#11539)
Should eliminate a error in the Firefox console regarding the connection being interrupted while the page was loading.
This commit is contained in:
		@@ -52,6 +52,9 @@ export function initNotificationCount() {
 | 
				
			|||||||
      source.close();
 | 
					      source.close();
 | 
				
			||||||
      window.location.href = AppSubUrl;
 | 
					      window.location.href = AppSubUrl;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					    window.addEventListener('beforeunload', () => {
 | 
				
			||||||
 | 
					      source.close();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user