From 56f968fb68ce9d05d123ccd386cac6d978a27249 Mon Sep 17 00:00:00 2001 From: Will Barnett Date: Fri, 13 Oct 2023 09:23:26 +0100 Subject: [PATCH] Added privaterepo parameter to menu links when a private activity is loaded and also cleaned authentication state and code parameters from url following authentication. --- platform/src/ActivityManager.js | 4 ++++ platform/src/Playground.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/platform/src/ActivityManager.js b/platform/src/ActivityManager.js index 0dee409..1101cfa 100644 --- a/platform/src/ActivityManager.js +++ b/platform/src/ActivityManager.js @@ -183,6 +183,10 @@ class ActivityManager { a.href += "&activities=" + this.activitiesUrl; } + if (urlParamPrivateRepo()){ + a.href += "&privaterepo=true" + } + li.appendChild(a); var icon = document.createElement("span"); diff --git a/platform/src/Playground.js b/platform/src/Playground.js index 75a07e5..b8000a6 100644 --- a/platform/src/Playground.js +++ b/platform/src/Playground.js @@ -98,6 +98,10 @@ if (urlParameters.has("code") && urlParameters.has("state") ){ } ); } +// Clean authentication parameters from url +urlParameters.delete("code"); +urlParameters.delete("state"); +window.history.replaceState({}, document.title, "/?" + urlParameters.toString()); function initialiseActivity(){