From 30a15a13788a89e0e8fa49f766aa0d69fd64a07f Mon Sep 17 00:00:00 2001 From: Chris Brewer Date: Thu, 8 Aug 2024 12:01:40 -0500 Subject: [PATCH] Allow adjust Santa's location using a query parameter. (#202) Co-authored-by: Chris Brewer --- static/entrypoint.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/entrypoint.js b/static/entrypoint.js index 13c56f7d4..aa8f4ea35 100644 --- a/static/entrypoint.js +++ b/static/entrypoint.js @@ -775,4 +775,16 @@ configureCustomKeys(loaderElement); global.setState({trackerOffset}); }; + // Outside of production, allow adjusting Santa's location using a query parameter. + if (window.location.hostname !== 'santatracker.google.com') { + try { + const params = new URLSearchParams(window.location.search); + const testLocation = params.get('adjustSanta'); + if (testLocation >= 0 && testLocation <= 1) { + window.santaApp.adjustSanta(testLocation); + } + } catch (e) { + // ignore + } + } }());