X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftracker%2FToggleIcon.js;h=0d8afa4068440afcd962fe3d5fe9c971506d2f32;hb=e0925d5b97ab0804222195eb4231c63b33703942;hp=98ae93240d0656087f0dd17719c9af89a9b80da1;hpb=abdc2ea1ade1fb12ceacc28660890750e69ae36f;p=alttp.git diff --git a/resources/js/components/tracker/ToggleIcon.js b/resources/js/components/tracker/ToggleIcon.js index 98ae932..0d8afa4 100644 --- a/resources/js/components/tracker/ToggleIcon.js +++ b/resources/js/components/tracker/ToggleIcon.js @@ -24,6 +24,7 @@ const ToggleIcon = ({ controller, className, icons, svg }) => { const activeController = controller || ToggleIcon.nullController; const active = activeController.getActive(state, icons); const defaultIcon = activeController.getDefault(state, icons); + const icon = active || defaultIcon || icons[0]; const classNames = ['toggle-icon']; if (active) { classNames.push('active'); @@ -36,6 +37,7 @@ const ToggleIcon = ({ controller, className, icons, svg }) => { if (svg) { return { activeController.handlePrimary(state, setManualState, icons); e.preventDefault(); @@ -47,7 +49,7 @@ const ToggleIcon = ({ controller, className, icons, svg }) => { e.stopPropagation(); }} > - + ; } return ({ + getActive: firstIcon, + getDefault: firstIcon, + handlePrimary: doNothing, + handleSecondary: () => removePin(pin), +}); + ToggleIcon.simpleController = { getActive: highestActive, getDefault: firstIcon,