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) {
|
if (marginAccounts.length > 0) {
|
||||||
set((state) => {
|
set((state) => {
|
||||||
state.marginAccounts = marginAccounts
|
state.marginAccounts = marginAccounts
|
||||||
state.selectedMarginAccount.initialLoad = false
|
|
||||||
if (state.selectedMarginAccount.current) {
|
if (state.selectedMarginAccount.current) {
|
||||||
state.selectedMarginAccount.current = marginAccounts.find(
|
state.selectedMarginAccount.current = marginAccounts.find(
|
||||||
(ma) =>
|
(ma) =>
|
||||||
|
@ -262,12 +261,12 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
set((state) => {
|
||||||
|
state.selectedMarginAccount.initialLoad = false
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(
|
console.error('Could not get margin accounts for wallet', err)
|
||||||
'Could not get margin accounts for user in effect ',
|
|
||||||
err
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async fetchAllMangoGroups() {
|
async fetchAllMangoGroups() {
|
||||||
|
|
Loading…
Reference in New Issue