Skip to content

Commit

Permalink
fix: fixing (explorer) type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Oct 2, 2024
1 parent aae1213 commit da71c0a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@
const action = Serializer.decode({
data: Bytes.from(data.data),
abi: data.abi,
type: data.action.name
type: String(data.action.name)
});
state = flatten(Serializer.objectify(action));
if (action) {
state = flatten(Serializer.objectify(action));
}
} catch (e) {
console.log(e);
console.error('Error decoding action:', e);
}
}
Expand All @@ -76,7 +78,7 @@
return Serializer.encode({
object: restructured,
abi: data.abi,
type: data.action.name
type: String(data.action.name)
});
} catch (e) {
console.log(e);
Expand All @@ -89,7 +91,7 @@
return Serializer.decode({
data: serialized,
abi: data.abi,
type: data.action.name
type: String(data.action.name)
});
} catch (e) {
console.log(e);
Expand Down Expand Up @@ -133,7 +135,7 @@

<Grid>
<Card>
<Fields abi={data.abi} fields={data.actionData.fields} {state} />
<Fields abi={data.abi} fields={data.actionData?.fields || []} {state} />
<Button onclick={transact} disabled={!decoded}>Perform Action</Button>
</Card>
<Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const { data } = $props();
const tableDef = data.abi.tables.find((t: ABI.Table) => t.name === data.table);
const struct = data.abi.structs.find((s: ABI.Struct) => s.name === tableDef.type);
const struct = data.abi.structs.find((s: ABI.Struct) => s.name === tableDef?.type);
</script>

<Stack>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import type { PageData } from './$types';
// import type { PageData } from './$types';
export let data: PageData;
// export let data: PageData;
</script>

<!--
Expand Down

0 comments on commit da71c0a

Please sign in to comment.