mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-08 08:27:19 +00:00
fix: hide the sidebar Models section when no pinned models resolve
This commit is contained in:
parent
29541cbb52
commit
3786234a31
2 changed files with 11 additions and 1 deletions
|
|
@ -122,6 +122,15 @@
|
|||
|
||||
let pinnedModels = [];
|
||||
|
||||
$: resolvedPinnedModels = (
|
||||
($settings?.pinnedModels ?? []).length > 0
|
||||
? ($settings?.pinnedModels ?? [])
|
||||
: ($config?.default_pinned_models ?? '').split(',')
|
||||
).filter((id) => {
|
||||
const model = ($models ?? []).find((m) => m.id === id);
|
||||
return model && !(model?.info?.meta?.hidden ?? false);
|
||||
});
|
||||
|
||||
let showPinnedModels = false;
|
||||
let showPinnedNotes = false;
|
||||
let showChannels = false;
|
||||
|
|
@ -1276,7 +1285,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{#if ($models ?? []).length > 0 && (($settings?.pinnedModels ?? []).length > 0 || $config?.default_pinned_models)}
|
||||
{#if resolvedPinnedModels.length > 0}
|
||||
<SidebarSection
|
||||
id="sidebar-models"
|
||||
bind:open={showPinnedModels}
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ type Config = {
|
|||
version: string;
|
||||
default_locale: string;
|
||||
default_models: string;
|
||||
default_pinned_models?: string;
|
||||
default_prompt_suggestions: PromptSuggestion[];
|
||||
features: {
|
||||
auth: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue