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