mirror of
https://github.com/nekename/OpenDeck.git
synced 2026-10-28 09:44:01 +00:00
fix: index more safely into an action's states in the instance editor as Toggle Action instances have more states than the base action does
This commit is contained in:
1 file changed
+2
-2
@@ -80,10 +80,10 @@
|
||||
on:drop={handleDrop}
|
||||
on:contextmenu={(event) => {
|
||||
event.preventDefault();
|
||||
instance.states[state].image = instance.action.states[state].image;
|
||||
instance.states[state].image = instance.action.states[state]?.image ?? instance.action.icon;
|
||||
}}
|
||||
>
|
||||
{#await renderImage(null, null, instance.states[state], instance.action.states[state].image ?? instance.action.icon, false, false, true, false, false, 0, true)}
|
||||
{#await renderImage(null, null, instance.states[state], instance.action.states[state]?.image ?? instance.action.icon, false, false, true, false, false, 0, true)}
|
||||
<div class="w-32 h-32 bg-neutral-800 animate-pulse rounded-xl"></div>
|
||||
{:then resolvedSrc}
|
||||
<img
|
||||
|
||||
Reference in new issue
Block a user