Let a dashboard be read against runs instead of the live engine
This commit is contained in:
@@ -7,6 +7,7 @@ import { handleError } from "@/utils"
|
||||
// The transmit ring's rule lives with the dashboard's own geometry, and CSS is
|
||||
// chunked per entry — so the sheet is pulled in wherever the pulse is drawn.
|
||||
import "./ui/core/core.css"
|
||||
import { useDataContext } from "./dataContext"
|
||||
import { usePublishMessage } from "./queries"
|
||||
import { useLocked } from "./settings"
|
||||
|
||||
@@ -54,7 +55,10 @@ function confirms(live: unknown, sent: unknown): boolean {
|
||||
export function usePublish(widget: WidgetDef, dashboard: string) {
|
||||
const cfg = (widget.config ?? {}) as Record<string, unknown>
|
||||
const target = cfg.target == null ? "" : String(cfg.target)
|
||||
const locked = useLocked()
|
||||
// A dashboard opened against a run or a replay is a picture of something
|
||||
// that already happened; there is nothing for a control to publish to.
|
||||
const context = useDataContext()
|
||||
const locked = useLocked() || Boolean(context?.readOnly)
|
||||
const publish = usePublishMessage()
|
||||
const live = useLiveValue(target || undefined)
|
||||
const { showErrorToast } = useCustomToast()
|
||||
|
||||
Reference in New Issue
Block a user