Fix problem with accounts

This commit is contained in:
Valtteri Karesto
2022-03-25 10:18:55 +02:00
parent 42c0b20512
commit e4238a40cc
4 changed files with 6 additions and 2 deletions

View File

@@ -112,7 +112,7 @@ const DebugStream = () => {
// Filter out account_info and account_objects requests
try {
const parsed = JSON.parse(log.jsonData);
if (parsed.id.includes("hooks-builder-req")) {
if (parsed?.id?._Request?.includes("hooks-builder-req")) {
return;
}
} catch (err) {

View File

@@ -59,6 +59,7 @@ export const addFaucetAccount = async (showToast: boolean = false) => {
sequence: 1,
hooks: [],
isLoading: false,
version: '2'
});
}
}

View File

@@ -151,7 +151,7 @@ export const deleteHook = async (account: IAccount & { name?: string }) => {
Account: account.address,
TransactionType: "SetHook",
Sequence: account.sequence,
Fee: "100000",
Fee: "1000000",
Hooks: [
{
Hook: {

View File

@@ -34,6 +34,7 @@ export interface IAccount {
sequence: number;
hooks: string[];
isLoading: boolean;
version?: string;
}
export interface ILog {
@@ -119,6 +120,8 @@ if (typeof window !== "undefined") {
if (localStorageAccounts) {
initialAccounts = JSON.parse(localStorageAccounts);
}
// filter out old accounts (they do not have version property at all)
initialAccounts = initialAccounts.filter(acc => acc.version === '2');
}
// Initialize state