fix account warning issues
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
</script>
|
||||
<button class="absolute top-2 right-2 z-10 text-white bg-red-800 hover:bg-red-600 p-2 rounded" on:click={() =>{
|
||||
alertMd($AccountWarning)
|
||||
$AccountWarning = ''
|
||||
}}>
|
||||
<AlertOctagon size={24} />
|
||||
</button>
|
||||
@@ -7,7 +7,9 @@ import { forageStorage, getUnpargeables, replaceDbResources } from "./globalApi"
|
||||
import { encodeRisuSave } from "./risuSave"
|
||||
import { v4 } from "uuid"
|
||||
|
||||
export const AccountWarning = writable('')
|
||||
export const AccountWarning = writable('TestError')
|
||||
|
||||
let seenWarnings:string[] = []
|
||||
|
||||
export class AccountStorage{
|
||||
auth:string
|
||||
@@ -30,7 +32,10 @@ export class AccountStorage{
|
||||
if(da.headers.get('Content-Type') === 'application/json'){
|
||||
const json = (await da.json())
|
||||
if(json?.warning){
|
||||
AccountWarning.set(json.warning)
|
||||
if(!seenWarnings.includes(json.warning)){
|
||||
seenWarnings.push(json.warning)
|
||||
AccountWarning.set(json.warning)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user