Fix prompt-url-widget session name API

This commit is contained in:
Mario Zechner 2026-01-15 17:50:24 +01:00
parent e46cc55fe0
commit f74f48660f

View file

@ -81,13 +81,13 @@ export default function promptUrlWidgetExtension(pi: ExtensionAPI) {
const trimmedTitle = title?.trim();
const fallbackName = `${label}: ${match.url}`;
const desiredName = trimmedTitle ? `${label}: ${trimmedTitle} (${match.url})` : fallbackName;
const currentName = ctx.getSessionName()?.trim();
const currentName = pi.getSessionName()?.trim();
if (!currentName) {
ctx.setSessionName(desiredName);
pi.setSessionName(desiredName);
return;
}
if (currentName === match.url || currentName === fallbackName) {
ctx.setSessionName(desiredName);
pi.setSessionName(desiredName);
}
};