mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
📌 fix: Exclude Pinned Keys from Cleanup and Fix MCP Pin State (#9867)
* fix: Prevent MCPSelect from rendering when not pinned and no values are available * fix: Exclude 'pinned' keys from timestamped storage cleanup logic * fix: Safeguard MCPSelect rendering by adding optional chaining for mcpValues
This commit is contained in:
parent
062d813b21
commit
712f0b3ca2
2 changed files with 8 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ function MCPSelectContent() {
|
||||||
const { conversationId, mcpServerManager } = useBadgeRowContext();
|
const { conversationId, mcpServerManager } = useBadgeRowContext();
|
||||||
const {
|
const {
|
||||||
localize,
|
localize,
|
||||||
|
isPinned,
|
||||||
mcpValues,
|
mcpValues,
|
||||||
isInitializing,
|
isInitializing,
|
||||||
placeholderText,
|
placeholderText,
|
||||||
|
|
@ -68,6 +69,10 @@ function MCPSelectContent() {
|
||||||
[getServerStatusIconProps, isInitializing],
|
[getServerStatusIconProps, isInitializing],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!isPinned && mcpValues?.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const configDialogProps = getConfigDialogProps();
|
const configDialogProps = getConfigDialogProps();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,9 @@ export function cleanupTimestampedStorage(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if this key should be timestamped
|
// Check if this key should be timestamped
|
||||||
const isTimestampedKey = TIMESTAMPED_KEYS.some((prefix) => key.startsWith(prefix));
|
const isTimestampedKey = TIMESTAMPED_KEYS.some(
|
||||||
|
(prefix) => key.startsWith(prefix) && !key.includes('pinned'),
|
||||||
|
);
|
||||||
|
|
||||||
if (isTimestampedKey && !key.endsWith(TIMESTAMP_SUFFIX)) {
|
if (isTimestampedKey && !key.endsWith(TIMESTAMP_SUFFIX)) {
|
||||||
const timestampKey = `${key}${TIMESTAMP_SUFFIX}`;
|
const timestampKey = `${key}${TIMESTAMP_SUFFIX}`;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue