Replace getExtensionPromptMaxDepth with a constant

0895bc6c1da516805651d8a0fe5367779ce0b31c

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -0Showing whitespace changes
public/script.js+3 -0
@@ -3051,10 +3051,13 @@ export async function getExtensionPromptByName(moduleName) {
3051 * @returns {number} Maximum depth of extension prompts3051 * @returns {number} Maximum depth of extension prompts
3052 */3052 */
3053export function getExtensionPromptMaxDepth() {3053export function getExtensionPromptMaxDepth() {
3054 return MAX_INJECTION_DEPTH;
3055 /*
3054 const prompts = Object.values(extension_prompts);3056 const prompts = Object.values(extension_prompts);
3055 const maxDepth = Math.max(...prompts.map(x => x.depth ?? 0));3057 const maxDepth = Math.max(...prompts.map(x => x.depth ?? 0));
3056 // Clamp to 1 <= depth <= MAX_INJECTION_DEPTH3058 // Clamp to 1 <= depth <= MAX_INJECTION_DEPTH
3057 return Math.max(Math.min(maxDepth, MAX_INJECTION_DEPTH), 1);3059 return Math.max(Math.min(maxDepth, MAX_INJECTION_DEPTH), 1);
3060 */
3058}3061}
30593062
3060/**3063/**