WIP #325
This commit is contained in:
@@ -173,16 +173,16 @@ export default {
|
||||
};
|
||||
|
||||
const moveCurrentLoginUserToFirstRow = () => {
|
||||
const currentLoginUsername = loginUserData.value.username;
|
||||
if(infiniteAcctData.value && infiniteAcctData.value.length){
|
||||
const index = allAccountResponsive.value.findIndex(user => user.username === currentLoginUsername);
|
||||
|
||||
if (index !== -1) {
|
||||
// 移除匹配的對象(現正登入的使用者)並將其插入到 infiniteAcctData 陣列的第一位
|
||||
const [loginUser] = allAccountResponsive.value[index];
|
||||
infiniteAcctData.value.unshift(loginUser);
|
||||
const loginUser = acctMgmtStore.allUserAccoutList.find(user => user.username === loginUserData.value.username);
|
||||
const index = infiniteAcctData.value.findIndex(user => user.username=== loginUserData.value.username);
|
||||
if(loginUser){
|
||||
infiniteAcctData.value.unshift(infiniteAcctData.value.splice(index, 1)[0]);
|
||||
console.log('第一個infiniteAcctData.value[0]', infiniteAcctData.value[0], 'loginUserData.value.username', loginUserData.value.username);
|
||||
console.log('infiniteAcctData.value[index]',infiniteAcctData.value[index] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const moveJustCreateUserToFirstRow = () => {
|
||||
@@ -190,7 +190,7 @@ export default {
|
||||
const index = acctMgmtStore.allUserAccoutList.findIndex(user => user.username === acctMgmtStore.justCreateUsername);
|
||||
if (index !== -1) {
|
||||
// 移除匹配的對象(剛剛新增的使用者)並將其插入到陣列的第一位
|
||||
const [justCreateUser] = acctMgmtStore.allUserAccoutList.splice(index, 1);
|
||||
const [justCreateUser] = acctMgmtStore.allUserAccoutList[index];
|
||||
infiniteAcctData.value.unshift(justCreateUser);
|
||||
}
|
||||
}
|
||||
@@ -248,6 +248,7 @@ export default {
|
||||
};
|
||||
|
||||
const onEditButtonClick = userNameToEdit => {
|
||||
console.log('onEditButtonClick userNameToEdit', userNameToEdit);
|
||||
acctMgmtStore.setCurrentViewingUser(userNameToEdit);
|
||||
modalStore.openModal(MODAL_ACCT_EDIT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user