Only display DEBUG button if the access token is set to 'debug'

This commit is contained in:
Kegan Dougal 2021-10-22 15:59:12 +01:00
parent 3564ef68f0
commit 42516c92cc
2 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@
<div class="header">
<input id="accessToken" type="password" placeholder="matrix.org access token" />
<input id="syncButton" type="button" value="Start Sync" />
<input id="debugButton" type="button" value="DEBUG" />
<input id="debugButton" type="button" value="DEBUG" style="display: none;" />
<span id="errorMsg"></span>
</div>
<div>

View File

@ -593,6 +593,10 @@ window.addEventListener('load', (event) => {
}
document.getElementById("syncButton").onclick = () => {
const accessToken = document.getElementById("accessToken").value;
if (accessToken === "debug") {
document.getElementById("debugButton").style = "";
return;
}
window.localStorage.setItem("accessToken", accessToken);
activeSessionId = new Date().getTime() + "";
doSyncLoop(accessToken, activeSessionId);