fix(planty): make sure config is completely static
Some checks failed
📊 Benchmark the Runtime / release (push) Successful in 54s
🚀 Lint & Test & Deploy / release (push) Failing after 57s

This commit is contained in:
2026-04-20 21:34:24 +02:00
parent 58d39cd101
commit e2f4a24f75
4 changed files with 14 additions and 9 deletions

View File

@@ -125,12 +125,7 @@ export const tutorialConfig: PlantyConfig = {
choices: [
{
label: '🔍 Explore Node Sourcecode',
onclick: () => {
window.open(
'https://git.max-richter.dev/max/nodarium/src/branch/main/nodes/max/plantarium',
'__blank'
);
}
action: 'open-github-nodes'
}
],
next: 'tour_viewer_nerd'

View File

@@ -184,6 +184,12 @@
pm.graph = g;
pm.saveGraph(g);
graphInterface.state.centerNode(graphInterface.manager.getAllNodes()[0]);
},
'open-github-nodes': () => {
window.open(
'https://github.com/jim-fx/nodarium/tree/main/nodes/max/plantarium',
'__blank'
);
}
}}
hooks={{

View File

@@ -200,8 +200,12 @@
onClose={stop}
onChoose={async (choice) => {
await _runAfter(currentNodeId!, currentNode);
if (choice && choice.onclick) {
choice.onclick();
if (choice && choice.action) {
if (choice.action in actions) {
actions[choice.action]();
} else {
console.warn(`Planty: No action found for ${choice.action}`);
}
return;
}
if (!choice.next) {

View File

@@ -34,7 +34,7 @@ export interface DialogNode {
export interface Choice {
label: string;
next?: string | null;
onclick?: () => void;
action?: string;
}
export interface PlantyConfig {