From 9e5f480050c4a5e01438817c7732ebb593fc8655 Mon Sep 17 00:00:00 2001 From: Kevin Lee <kevin@infinite-lee.com> Date: Wed, 22 Nov 2017 14:57:30 -0800 Subject: [PATCH] add back in name from query string. If you set a name from qs, it will not show prompt (prompts are broken on mobile) --- src/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index bf03ae369..c9a1ead11 100644 --- a/src/index.js +++ b/src/index.js @@ -78,12 +78,17 @@ window.App = { let username; const jwt = getCookie("jwt"); - if (jwt) { + if (jwt) { //grab name from jwt const data = parseJwt(jwt); username = data.typ.name; } - - username = promptForName(username); // promptForName is blocking + + if (qs.name) { + username = qs.name; //always override with name from querystring if available + } + else { + username = promptForName(username); // promptForName is blocking + } const myNametag = document.querySelector("#player-rig .nametag"); myNametag.setAttribute("text", "value", username); -- GitLab