feat: now respect codestyle
All checks were successful
CI / build (push) Successful in 4s

This commit is contained in:
Pierre Tellier
2025-02-09 15:59:30 +01:00
parent a859871265
commit 645a10477d
16 changed files with 1764 additions and 312 deletions

View File

@ -1,6 +1,11 @@
import {ref} from "vue";
import {type Ref} from "vue";
enum color {Red, Yellow, Blue, Green}
import { ref, type Ref } from "vue";
enum color {
Red,
Yellow,
Blue,
Green,
}
type ErrorMessageContent = {
message: string;
@ -11,23 +16,28 @@ type ErrorMessageContent = {
let id: number = 0;
const getId = () => {
id = id+1;
id = id + 1;
return id;
}
};
function addNewMessage(errorMessage: string, type?: color, timeout?: number){
if (timeout == null){
function addNewMessage(errorMessage: string, type?: color, timeout?: number) {
if (timeout == null) {
timeout = 5000;
}
if (type == null){
if (type == null) {
type = color.Red;
}
const data: ErrorMessageContent = {message: errorMessage, timeout: timeout, color: type, id: getId()};
errorList.value.push(data)
setTimeout(() => errorList.value.slice(0, 1), timeout)
const data: ErrorMessageContent = {
message: errorMessage,
timeout: timeout,
color: type,
id: getId(),
};
errorList.value.push(data);
setTimeout(() => errorList.value.slice(0, 1), timeout);
}
const errorList: Ref<ErrorMessageContent[]>= ref([])
const errorList: Ref<ErrorMessageContent[]> = ref([]);
export {addNewMessage, errorList, color, type ErrorMessageContent}
export { addNewMessage, errorList, color, type ErrorMessageContent };