Skip to content

Commit

Permalink
fix safe loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
HoangNDM6 committed Sep 7, 2023
1 parent cc2fe6e commit 2ad87de
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/logic/safe/store/actions/fetchSafe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ async function _getSafeInfo(safeAddress: string, safeId: number): Promise<[IMSaf
throw new Error("Get Safe Info failed");
}

const isSafeLoaded = accountAssetData && mSafeInfotData && accountInfoData
const isSafeLoaded = !!(accountAssetData && mSafeInfotData && accountInfoData)
const formatMSafeInfotData: IMSafeInfo = {
...mSafeInfotData,
accountNumber: String(accountInfoData?.account_number),
Expand Down Expand Up @@ -315,7 +315,4 @@ async function _getSafeInfo(safeAddress: string, safeId: number): Promise<[IMSaf
}

return [formatMSafeInfotData, safeInfoData, accountInfoData, isSafeLoaded]



}
1 change: 1 addition & 0 deletions src/logic/safe/store/models/safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const makeSafe = Record<SafeRecordProps>({
sequence: '1',
coinConfig: [],
isHideZeroBalance: true,
isSafeLoaded: undefined,
})

export type SafeRecord = RecordOf<SafeRecordProps>
Expand Down
2 changes: 1 addition & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export async function getDetailToken(address: string): Promise<IResponse<any>> {
export async function fetchAccountInfo(safeAddress: string) {
try {
const response = await getAccountInfo(safeAddress);
const accountInfo = response.account[0];
const accountInfo = response.account[0] ?? { account_number: 0, sequence: 0, balances: [] };
return accountInfo;
} catch (error) {
try {
Expand Down

0 comments on commit 2ad87de

Please sign in to comment.