From f4257a28ba1fcee5a053e1ce14a6ea771f54b46d Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 4 Dec 2021 21:04:22 -0500 Subject: [PATCH] pad: Delete duplicate `decodeURIComponent()` calls `URL.searchParams` already decodes the value. Also delete some useless comments. --- src/static/js/pad.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 306c2b191..3a372d1ce 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -95,24 +95,20 @@ const getParameters = [ settings.useMonospaceFontGlobal = true; }, }, - // If the username is set as a parameter we should set a global value that we can call once we - // have initiated the pad. { name: 'userName', checkVal: null, callback: (val) => { - settings.globalUserName = decodeURIComponent(val); - clientVars.userName = decodeURIComponent(val); + settings.globalUserName = val; + clientVars.userName = val; }, }, - // If the userColor is set as a parameter, set a global value to use once we have initiated the - // pad. { name: 'userColor', checkVal: null, callback: (val) => { - settings.globalUserColor = decodeURIComponent(val); - clientVars.userColor = decodeURIComponent(val); + settings.globalUserColor = val; + clientVars.userColor = val; }, }, {