fix: can't edit blank actions

fixes #110
This commit is contained in:
2024-04-29 09:35:22 +02:00
parent f322435c41
commit 4007810c7b
2 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
name: CharaChorder name: CharaChorder
description: CharaChorder specific actions description: CharaChorder specific actions
actions: actions:
0:
id: "No Action"
528: 528:
id: "RESTART" id: "RESTART"
title: Restart Device title: Restart Device

View File

@@ -127,12 +127,11 @@
const clickedGroup = groupParent.children.item(index) as SVGGElement; const clickedGroup = groupParent.children.item(index) as SVGGElement;
const nextAction = get(layout)[get(activeLayer)]?.[keyInfo.id]; const nextAction = get(layout)[get(activeLayer)]?.[keyInfo.id];
const currentAction = get(deviceLayout)[get(activeLayer)]?.[keyInfo.id]; const currentAction = get(deviceLayout)[get(activeLayer)]?.[keyInfo.id];
if (!nextAction || !currentAction) return;
const component = new ActionSelector({ const component = new ActionSelector({
target: document.body, target: document.body,
props: { props: {
currentAction, currentAction,
nextAction: nextAction.isApplied ? undefined : nextAction.action, nextAction: nextAction?.isApplied ? undefined : nextAction?.action,
}, },
}); });
const dialog = document.querySelector("dialog > div") as HTMLDivElement; const dialog = document.querySelector("dialog > div") as HTMLDivElement;