Skip to content

Commit

Permalink
frontend: PluginSettings: Fix non responsive enable toggle
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent T <[email protected]>
  • Loading branch information
vyncent-t committed Dec 11, 2024
1 parent 573443c commit c9e15b0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/components/App/PluginSettings/PluginSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,21 @@ export function PluginSettingsPure(props: PluginSettingsPureProps) {
},
{
header: t('translation|Enable'),
accessorFn: (plugin: PluginInfo) => plugin.isEnabled,
Cell: ({ row: { original: plugin } }: { row: MRT_Row<PluginInfo> }) => {
if (!plugin.isCompatible || !helpers.isElectron()) {
return null;
}
return (
<EnableSwitch
aria-label={`Toggle ${plugin.name}`}
checked={plugin.isEnabled}
checked={!!plugin.isEnabled}
onChange={() => switchChangeHanlder(plugin)}
color="primary"
name={plugin.name}
/>
);
},
sort: (a: PluginInfo, b: PluginInfo) =>
a.isEnabled === b.isEnabled ? 0 : a.isEnabled ? -1 : 1,
},
]
// remove the enable column if we're not in app mode
Expand Down

0 comments on commit c9e15b0

Please sign in to comment.