fix to set initialLoad state when loading margin account
This commit is contained in:
parent
4f7e1b4990
commit
a38752d792
|
@ -249,7 +249,6 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
|||
if (marginAccounts.length > 0) {
|
||||
set((state) => {
|
||||
state.marginAccounts = marginAccounts
|
||||
state.selectedMarginAccount.initialLoad = false
|
||||
if (state.selectedMarginAccount.current) {
|
||||
state.selectedMarginAccount.current = marginAccounts.find(
|
||||
(ma) =>
|
||||
|
@ -262,12 +261,12 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
|||
}
|
||||
})
|
||||
}
|
||||
set((state) => {
|
||||
state.selectedMarginAccount.initialLoad = false
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(
|
||||
'Could not get margin accounts for user in effect ',
|
||||
err
|
||||
)
|
||||
console.error('Could not get margin accounts for wallet', err)
|
||||
})
|
||||
},
|
||||
async fetchAllMangoGroups() {
|
||||
|
|
Loading…
Reference in New Issue