Connect accumulator preview by store key
This commit is contained in:
@@ -46,6 +46,12 @@ function outputStatus(output) {
|
||||
return status || "";
|
||||
}
|
||||
|
||||
function outputStoreKey(output) {
|
||||
const key = output?.store_key;
|
||||
if (Array.isArray(key)) return key[0] || "";
|
||||
return key || "";
|
||||
}
|
||||
|
||||
function outputEntries(output) {
|
||||
const entries = output?.entries;
|
||||
if (!entries) return [];
|
||||
@@ -91,7 +97,7 @@ function selectedEntry(node) {
|
||||
}
|
||||
|
||||
function storeKey(node) {
|
||||
return String(widget(node, "store_key")?.value || "").trim();
|
||||
return String(widget(node, "store_key")?.value || node._sxcpResolvedStoreKey || "").trim();
|
||||
}
|
||||
|
||||
async function postJson(path, payload) {
|
||||
@@ -196,6 +202,7 @@ app.registerExtension({
|
||||
const node = getNodeById(detail?.node);
|
||||
if (!isAccumulatorPreviewNode(node)) return;
|
||||
const output = detail?.output || {};
|
||||
node._sxcpResolvedStoreKey = outputStoreKey(output);
|
||||
setEntries(node, outputEntries(output), outputStatus(output));
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user