mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	| @@ -20,6 +20,10 @@ function shouldIgnoreError(err: Error) { | ||||
|  | ||||
| export function showGlobalErrorMessage(msg: string, msgType: Intent = 'error') { | ||||
|   const msgContainer = document.querySelector('.page-content') ?? document.body; | ||||
|   if (!msgContainer) { | ||||
|     alert(`${msgType}: ${msg}`); | ||||
|     return; | ||||
|   } | ||||
|   const msgCompact = msg.replace(/\W/g, '').trim(); // compact the message to a data attribute to avoid too many duplicated messages | ||||
|   let msgDiv = msgContainer.querySelector<HTMLDivElement>(`.js-global-error[data-global-error-msg-compact="${msgCompact}"]`); | ||||
|   if (!msgDiv) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user