From 6f810f05a048ae002f9f0b7c18610d915b54e833 Mon Sep 17 00:00:00 2001 From: Spicy_Marinara Date: Tue, 14 Oct 2025 22:54:09 +0200 Subject: [PATCH] Fix time editing in Info Box - set both start and end time to edited value --- index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index eb2db0b..8ef4f6a 100644 --- a/index.js +++ b/index.js @@ -9,8 +9,8 @@ const extensionName = 'third-party/rpg-companion-sillytavern'; // This supports both global (public/extensions) and user-specific (data/default-user/extensions) installations const currentScriptPath = import.meta.url; const isUserExtension = currentScriptPath.includes('/data/') || currentScriptPath.includes('\\data\\'); -const extensionFolderPath = isUserExtension - ? `data/default-user/extensions/${extensionName}` +const extensionFolderPath = isUserExtension + ? `data/default-user/extensions/${extensionName}` : `scripts/extensions/${extensionName}`; let extensionSettings = { @@ -2352,10 +2352,8 @@ function updateInfoBoxField(field, value) { return `🌑️: ${value}`; } else if (field === 'timeStart' && line.includes('πŸ•’:')) { // Update time format: "HH:MM β†’ HH:MM" - const currentTime = line.replace('πŸ•’:', '').trim(); - const timeParts = currentTime.split('β†’').map(t => t.trim()); - const timeEnd = timeParts[1] || timeParts[0]; // Keep end time or use start as both - return `πŸ•’: ${value} β†’ ${timeEnd}`; + // When user edits, set both start and end time to the new value + return `πŸ•’: ${value} β†’ ${value}`; } else if (field === 'location' && line.includes('πŸ—ΊοΈ:')) { return `πŸ—ΊοΈ: ${value}`; }