fix: changed configs
This commit is contained in:
17
front/MyINPulse-front/src/services/popupDisplayer.ts
Normal file
17
front/MyINPulse-front/src/services/popupDisplayer.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import {ref} from "vue";
|
||||
enum errorType {Error, Warning}
|
||||
|
||||
function addNewError(errorMessage: string, timeout?: number, type?: errorType){
|
||||
if (timeout == null){
|
||||
timeout = 5000;
|
||||
}
|
||||
if (type == null){
|
||||
type = Error;
|
||||
}
|
||||
errorList.value.push({errorMessage: errorMessage, timeout: timeout, type: type})
|
||||
setTimeout(() => errorList.value.pop(errorMessage), 5000)
|
||||
}
|
||||
|
||||
const errorList = ref([])
|
||||
|
||||
export {addNewError, errorList}
|
Reference in New Issue
Block a user