Remove duplicate getUserData call in moveCurrentLoginUserToFirstRow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 09:25:10 +08:00
parent 9a8b45b151
commit 984eaa96b7

View File

@@ -126,7 +126,6 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
*/ */
async moveCurrentLoginUserToFirstRow(fetchedUserList: User[]): Promise<User[]> { async moveCurrentLoginUserToFirstRow(fetchedUserList: User[]): Promise<User[]> {
const loginStore = useLoginStore(); const loginStore = useLoginStore();
await loginStore.getUserData();
const loginUserData:User = loginStore.userData; const loginUserData:User = loginStore.userData;
const foundLoginUserIndex = fetchedUserList.findIndex(user => user.username === loginUserData.username); const foundLoginUserIndex = fetchedUserList.findIndex(user => user.username === loginUserData.username);
fetchedUserList.unshift(fetchedUserList.splice(foundLoginUserIndex, 1)[0]); fetchedUserList.unshift(fetchedUserList.splice(foundLoginUserIndex, 1)[0]);