|
10 | 10 | size="36px"
|
11 | 11 | :src="
|
12 | 12 | selectedAccount
|
13 |
| - ? `https://mc-heads.net/avatar/${selectedAccount.id}/128` |
| 13 | + ? `https://mc-heads.net/avatar/${selectedAccount.profile.id}/128` |
14 | 14 | : 'https://launcher-files.modrinth.com/assets/steve_head.png'
|
15 | 15 | "
|
16 | 16 | />
|
17 | 17 | <div class="flex flex-col w-full">
|
18 |
| - <span>{{ selectedAccount ? selectedAccount.username : 'Select account' }}</span> |
| 18 | + <span>{{ selectedAccount ? selectedAccount.profile.name : 'Select account' }}</span> |
19 | 19 | <span class="text-secondary text-xs">Minecraft account</span>
|
20 | 20 | </div>
|
21 | 21 | <DropdownIcon class="w-5 h-5 shrink-0" />
|
|
28 | 28 | :class="{ expanded: mode === 'expanded', isolated: mode === 'isolated' }"
|
29 | 29 | >
|
30 | 30 | <div v-if="selectedAccount" class="selected account">
|
31 |
| - <Avatar size="xs" :src="`https://mc-heads.net/avatar/${selectedAccount.id}/128`" /> |
| 31 | + <Avatar size="xs" :src="`https://mc-heads.net/avatar/${selectedAccount.profile.id}/128`" /> |
32 | 32 | <div>
|
33 |
| - <h4>{{ selectedAccount.username }}</h4> |
| 33 | + <h4>{{ selectedAccount.profile.name }}</h4> |
34 | 34 | <p>Selected</p>
|
35 | 35 | </div>
|
36 |
| - <Button v-tooltip="'Log out'" icon-only color="raised" @click="logout(selectedAccount.id)"> |
| 36 | + <Button v-tooltip="'Log out'" icon-only color="raised" @click="logout(selectedAccount.profile.id)"> |
37 | 37 | <TrashIcon />
|
38 | 38 | </Button>
|
39 | 39 | </div>
|
|
44 | 44 | </Button>
|
45 | 45 | </div>
|
46 | 46 | <div v-if="displayAccounts.length > 0" class="account-group">
|
47 |
| - <div v-for="account in displayAccounts" :key="account.id" class="account-row"> |
| 47 | + <div v-for="account in displayAccounts" :key="account.profile.id" class="account-row"> |
48 | 48 | <Button class="option account" @click="setAccount(account)">
|
49 |
| - <Avatar :src="`https://mc-heads.net/avatar/${account.id}/128`" class="icon" /> |
50 |
| - <p>{{ account.username }}</p> |
| 49 | + <Avatar :src="`https://mc-heads.net/avatar/${account.profile.id}/128`" class="icon" /> |
| 50 | + <p>{{ account.profile.name }}</p> |
51 | 51 | </Button>
|
52 |
| - <Button v-tooltip="'Log out'" icon-only @click="logout(account.id)"> |
| 52 | + <Button v-tooltip="'Log out'" icon-only @click="logout(account.profile.id)"> |
53 | 53 | <TrashIcon />
|
54 | 54 | </Button>
|
55 | 55 | </div>
|
@@ -101,16 +101,16 @@ defineExpose({
|
101 | 101 | await refreshValues()
|
102 | 102 |
|
103 | 103 | const displayAccounts = computed(() =>
|
104 |
| - accounts.value.filter((account) => defaultUser.value !== account.id), |
| 104 | + accounts.value.filter((account) => defaultUser.value !== account.profile.id), |
105 | 105 | )
|
106 | 106 |
|
107 | 107 | const selectedAccount = computed(() =>
|
108 |
| - accounts.value.find((account) => account.id === defaultUser.value), |
| 108 | + accounts.value.find((account) => account.profile.id === defaultUser.value), |
109 | 109 | )
|
110 | 110 |
|
111 | 111 | async function setAccount(account) {
|
112 |
| - defaultUser.value = account.id |
113 |
| - await set_default_user(account.id).catch(handleError) |
| 112 | + defaultUser.value = account.profile.id |
| 113 | + await set_default_user(account.profile.id).catch(handleError) |
114 | 114 | emit('change')
|
115 | 115 | }
|
116 | 116 |
|
|
0 commit comments