mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 23:04:41 +00:00
Fix prompt-url-widget session name API
This commit is contained in:
parent
e46cc55fe0
commit
f74f48660f
1 changed files with 3 additions and 3 deletions
|
|
@ -81,13 +81,13 @@ export default function promptUrlWidgetExtension(pi: ExtensionAPI) {
|
||||||
const trimmedTitle = title?.trim();
|
const trimmedTitle = title?.trim();
|
||||||
const fallbackName = `${label}: ${match.url}`;
|
const fallbackName = `${label}: ${match.url}`;
|
||||||
const desiredName = trimmedTitle ? `${label}: ${trimmedTitle} (${match.url})` : fallbackName;
|
const desiredName = trimmedTitle ? `${label}: ${trimmedTitle} (${match.url})` : fallbackName;
|
||||||
const currentName = ctx.getSessionName()?.trim();
|
const currentName = pi.getSessionName()?.trim();
|
||||||
if (!currentName) {
|
if (!currentName) {
|
||||||
ctx.setSessionName(desiredName);
|
pi.setSessionName(desiredName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (currentName === match.url || currentName === fallbackName) {
|
if (currentName === match.url || currentName === fallbackName) {
|
||||||
ctx.setSessionName(desiredName);
|
pi.setSessionName(desiredName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue