Skip to content

Commit

Permalink
Merge pull request #2667 from headlamp-k8s/fix-plugin-settings-toggle
Browse files Browse the repository at this point in the history
frontend: PluginSettings: Fix non responsive enable toggle
  • Loading branch information
joaquimrocha authored Dec 11, 2024
2 parents 573443c + c9e15b0 commit e8cd1d2
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 e8cd1d2

Please sign in to comment.