fix(webui): show all channels when only WebUI is enabled
This commit is contained in:
1 parent
ea9d13cbeb
commit
78cdf53ac3
2 files changed
+27
-3
No files matched your search
@@ -49,13 +49,14 @@ export function ChannelsSettings({
|
||||
.filter((feature) => feature.type === "channel" && feature.settings_visible !== false)
|
||||
.sort((left, right) => Number(!left.ready) - Number(!right.ready)
|
||||
|| localizedChannelDisplayName(left, t).localeCompare(localizedChannelDisplayName(right, t)));
|
||||
const hasEnabledChannels = channels.some((feature) => feature.enabled);
|
||||
const hasEnabledConfigurableChannels = channels.some((feature) =>
|
||||
feature.enabled && !feature.capabilities?.includes("always_enabled"));
|
||||
const restartRequired = requiresRestartPending || Boolean(nanobotFeatures?.requires_restart);
|
||||
useLayoutEffect(() => {
|
||||
if (!nanobotFeatures || filterInitializedRef.current) return;
|
||||
filterInitializedRef.current = true;
|
||||
setFilter(hasEnabledChannels ? "enabled" : "all");
|
||||
}, [hasEnabledChannels, nanobotFeatures]);
|
||||
setFilter(hasEnabledConfigurableChannels ? "enabled" : "all");
|
||||
}, [hasEnabledConfigurableChannels, nanobotFeatures]);
|
||||
const visibleChannels = channels.filter((feature) =>
|
||||
(filter === "all" || feature.enabled)
|
||||
&& `${feature.name} ${localizedChannelDisplayName(feature, t)}`.toLocaleLowerCase()
|
||||
|
||||
Reference in new issue
Block a user