mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-27 01:06:29 +01:00
Add UID on account list
This commit is contained in:
parent
fece737b75
commit
99cef3604f
1 changed files with 18 additions and 5 deletions
|
@ -43,6 +43,7 @@
|
|||
let selectedServer = null;
|
||||
let arInput = '';
|
||||
let wlInput = '';
|
||||
let accountList = [];
|
||||
|
||||
function signIn() {
|
||||
gapi.auth2.getAuthInstance().signIn();
|
||||
|
@ -65,6 +66,12 @@
|
|||
console.log('wl update');
|
||||
wlInput = val;
|
||||
});
|
||||
accounts.subscribe((val) => {
|
||||
console.log('accounts update');
|
||||
getAccountList(val);
|
||||
});
|
||||
|
||||
mounted = true;
|
||||
});
|
||||
|
||||
function updateServer() {
|
||||
|
@ -208,6 +215,16 @@
|
|||
closeModal();
|
||||
}
|
||||
|
||||
async function getAccountList(accounts) {
|
||||
accountList = [];
|
||||
for (const acc of accounts) {
|
||||
const prefix = acc.value === 'main' ? '' : `${acc.value}-`;
|
||||
const uid = await readSave(`${prefix}wish-uid`);
|
||||
accountList.push({ ...acc, label: `${acc.label} ${uid !== null ? `UID:${uid}` : ''}` });
|
||||
console.log(prefix, uid);
|
||||
}
|
||||
}
|
||||
|
||||
function openDeleteAccount() {
|
||||
openModal(
|
||||
DeleteAccountModal,
|
||||
|
@ -260,10 +277,6 @@
|
|||
);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
mounted = true;
|
||||
});
|
||||
|
||||
$: currentAccount, selectAccount();
|
||||
$: selectedServer, updateServer();
|
||||
$: arInput, updateAR();
|
||||
|
@ -291,7 +304,7 @@
|
|||
<Select
|
||||
className="w-64 mr-2"
|
||||
bind:selected={currentAccount}
|
||||
options={$accounts}
|
||||
options={accountList}
|
||||
placeholder={$t('settings.selectAccount')}
|
||||
/>
|
||||
<div class="flex flex-1 mt-2 md:mt-0">
|
||||
|
|
Loading…
Reference in a new issue