fix: use selected runtime types on runtime and viewFn queries (#177)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { runtimeCtx$ } from "@/state/chains/chain.state"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { selectedBlock$ } from "@/pages/Storage/BlockPicker"
|
||||
import { byteArraysAreEqual } from "@/utils/byteArray"
|
||||
import {
|
||||
CodecComponentType,
|
||||
@@ -20,10 +21,10 @@ import { EditCodec } from "../EditCodec"
|
||||
import { TreeCodec } from "../EditCodec/Tree"
|
||||
import { BinaryDisplay } from "./BinaryDisplay"
|
||||
import { FocusPath } from "./FocusPath"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const editTypeMetadataProps$ = state(
|
||||
runtimeCtx$.pipe(
|
||||
selectedBlock$.pipe(
|
||||
map(({ ctx }) => ctx),
|
||||
map(({ dynamicBuilder, lookup }) => ({
|
||||
builder: dynamicBuilder,
|
||||
metadata: lookup.metadata,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
import { ActionButton } from "@/components/ActionButton"
|
||||
import { ExpandBtn } from "@/components/Expand"
|
||||
import { useNavigate } from "@/hashParams"
|
||||
import { client$, dynamicBuilder$, lookup$ } from "@/state/chains/chain.state"
|
||||
import { client$, dynamicBuilder$ } from "@/state/chains/chain.state"
|
||||
import { getTypeComplexity } from "@/utils/shape"
|
||||
import { state, useStateObservable, withDefault } from "@react-rxjs/core"
|
||||
import { createSignal } from "@react-rxjs/utils"
|
||||
@@ -141,7 +141,10 @@ const inputValue$ = state(
|
||||
(idx: number) => inputValues$.pipe(map((v) => v[idx])),
|
||||
null,
|
||||
)
|
||||
const lookupState$ = state(lookup$, null)
|
||||
const lookupState$ = state(
|
||||
selectedBlock$.pipe(map(({ ctx }) => ctx.lookup)),
|
||||
null,
|
||||
)
|
||||
const RuntimeValueInput: FC<{ idx: number; name: string; type: number }> = ({
|
||||
idx,
|
||||
type,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
import { ActionButton } from "@/components/ActionButton"
|
||||
import { ExpandBtn } from "@/components/Expand"
|
||||
import { useNavigate } from "@/hashParams"
|
||||
import { client$, dynamicBuilder$, lookup$ } from "@/state/chains/chain.state"
|
||||
import { client$, dynamicBuilder$ } from "@/state/chains/chain.state"
|
||||
import { getTypeComplexity } from "@/utils/shape"
|
||||
import { state, useStateObservable, withDefault } from "@react-rxjs/core"
|
||||
import { createSignal } from "@react-rxjs/utils"
|
||||
@@ -138,7 +138,10 @@ const inputValue$ = state(
|
||||
(idx: number) => inputValues$.pipe(map((v) => v[idx])),
|
||||
null,
|
||||
)
|
||||
const lookupState$ = state(lookup$, null)
|
||||
const lookupState$ = state(
|
||||
selectedBlock$.pipe(map(({ ctx }) => ctx.lookup)),
|
||||
null,
|
||||
)
|
||||
const RuntimeValueInput: FC<{ idx: number; name: string; type: number }> = ({
|
||||
idx,
|
||||
type,
|
||||
|
||||
Reference in New Issue
Block a user