• Steven's avatar
    fix: shortcut edit button opens create dialog instead of edit dialog · e7605d90
    Steven authored
    Fixed issue #5576 where clicking the edit button on a shortcut would
    incorrectly open a create dialog instead of an edit dialog.
    
    The root cause was an incorrect useEffect that was watching the shortcut
    state itself instead of the initialShortcut prop. When the dialog was
    opened for editing, the state wasn't properly reinitializing with the
    existing shortcut data.
    
    Changed the useEffect to:
    - Watch initialShortcut as the dependency
    - Reinitialize the shortcut state when initialShortcut changes
    - Properly distinguishes between create (initialShortcut undefined) and
      edit (initialShortcut has data) modes
    e7605d90
CreateShortcutDialog.tsx 4.57 KB