mirror of https://github.com/hykilpikonna/AquaDX
[+] Only show UserBox if user played chuni
parent
6b71e2f22a
commit
836f789fc9
|
@ -3,7 +3,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { slide, fade } from "svelte/transition";
|
import { slide, fade } from "svelte/transition";
|
||||||
import type { AquaNetUser, GameOption } from "../../libs/generalTypes";
|
import type { AquaNetUser, GameOption } from "../../libs/generalTypes";
|
||||||
import { SETTING, USER } from "../../libs/sdk";
|
import {CARD, SETTING, USER} from "../../libs/sdk";
|
||||||
import StatusOverlays from "../../components/StatusOverlays.svelte";
|
import StatusOverlays from "../../components/StatusOverlays.svelte";
|
||||||
import Icon from "@iconify/svelte";
|
import Icon from "@iconify/svelte";
|
||||||
import { pfp } from "../../libs/ui";
|
import { pfp } from "../../libs/ui";
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
let error: string;
|
let error: string;
|
||||||
let submitting = ""
|
let submitting = ""
|
||||||
let tab = 0
|
let tab = 0
|
||||||
const tabs = [ 'profile', 'game', 'userbox']
|
let tabs = [ 'profile', 'game' ]
|
||||||
|
|
||||||
const profileFields = [
|
const profileFields = [
|
||||||
[ 'displayName', t('settings.profile.name') ],
|
[ 'displayName', t('settings.profile.name') ],
|
||||||
|
@ -34,6 +34,13 @@
|
||||||
gameFields = s
|
gameFields = s
|
||||||
me = m
|
me = m
|
||||||
values = profileFields.map(([field]) => me[field as keyof AquaNetUser])
|
values = profileFields.map(([field]) => me[field as keyof AquaNetUser])
|
||||||
|
|
||||||
|
CARD.userGames(m.username).then(games => {
|
||||||
|
|
||||||
|
if (games.chu3 && !tabs.includes('userbox')) {
|
||||||
|
tabs = [...tabs, 'userbox']
|
||||||
|
}
|
||||||
|
})
|
||||||
}).catch(e => error = e.message)
|
}).catch(e => error = e.message)
|
||||||
getMe()
|
getMe()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue