replacing site-local error display by global error display
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
export const messages = $state({error:null,warning:null});
|
||||
|
||||
export function error(msg){
|
||||
messages.error = msg;
|
||||
async function process(msg){
|
||||
if (msg instanceof Response) return await msg.text();
|
||||
return msg;
|
||||
}
|
||||
|
||||
export function warn(msg){
|
||||
messages.warning = msg;
|
||||
export async function error(msg){
|
||||
messages.error = await process(msg);
|
||||
}
|
||||
|
||||
export async function warn(msg){
|
||||
messages.warning = await process(msg);
|
||||
}
|
||||
|
||||
export function yikes(){
|
||||
|
||||
Reference in New Issue
Block a user