mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 02:46:04 +01:00 
			
		
		
		
	Add toasts to UI (#25449)
Fixes https://github.com/go-gitea/gitea/issues/24353 In some case like async success/error, it is useful to show toasts in UI.
This commit is contained in:
		| @@ -1,5 +1,6 @@ | ||||
| import $ from 'jquery'; | ||||
| import {svg} from '../svg.js'; | ||||
| import {showErrorToast} from '../modules/toast.js'; | ||||
|  | ||||
| const {appSubUrl, csrfToken} = window.config; | ||||
| let i18nTextEdited; | ||||
| @@ -39,12 +40,12 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH | ||||
|             if (resp.ok) { | ||||
|               $dialog.modal('hide'); | ||||
|             } else { | ||||
|               alert(resp.message); | ||||
|               showErrorToast(resp.message); | ||||
|             } | ||||
|           }); | ||||
|         } | ||||
|       } else { // required by eslint | ||||
|         window.alert(`unknown option item: ${optionItem}`); | ||||
|         showErrorToast(`unknown option item: ${optionItem}`); | ||||
|       } | ||||
|     }, | ||||
|     onHide() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user