fix(planty): make sure config is completely static
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface DialogNode {
|
||||
export interface Choice {
|
||||
label: string;
|
||||
next?: string | null;
|
||||
onclick?: () => void;
|
||||
action?: string;
|
||||
}
|
||||
|
||||
export interface PlantyConfig {
|
||||
|
||||
Reference in New Issue
Block a user