Fix legacy name prefix removal using wrong variable in bookmarks Fixes leftover bug from #4993. In both `getBookmarkName` and `createBranch`, the second regex replacement was incorrectly using the original `name` variable instead of the already-cleaned `cleanName` variable, causing the legacy prefix removal to fail.

9b0f0dcc9a99e807cdb55f9f8b6326896713c87c

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +2 -2Ignore whitespace
public/scripts/bookmarks.js+2 -2
@@ -88,7 +88,7 @@ async function getBookmarkName({ isReplace = false, forceName = null } = {}) {
8888 // Strip off existing suffixes, then build new name
8989 let cleanName = name.replace(new RegExp(` - ${bookmarkNameToken}\\d+$`), '');
9090 // Strip off legacy old name prefix too
9191 cleanName = namecleanName.replace(new RegExp(`^${bookmarkNameToken}\\d+ - `), '');
9292 return `${cleanName} - ${bookmarkNameToken}${i}`;
9393 }
9494 const existingChats = await getExistingChatNames();
@@ -183,7 +183,7 @@ export async function createBranch(mesId) {
183183 // Strip off existing suffixes, then build new name
184184 let cleanName = name.replace(/ - Branch #\d+$/, '');
185185 // Strip off legacy old name prefix too
186186 cleanName = namecleanName.replace(/^Branch #\d+ - /, '');
187187 return `${cleanName} - Branch #${i}`;
188188 }
189189 const existingChats = await getExistingChatNames();