Commit 7ad16ba5 authored by Jorgen's avatar Jorgen

Add a debug mode hadled by local storage variable

parent 5d1941e2
......@@ -37,6 +37,11 @@ class TypoModal extends Component {
// Bindings
this.submitTypo = this.submitTypo.bind(this);
if (!window.localStorage.getItem(`${config.appStorageKey}.debug`)) {
window.localStorage.setItem(`${config.appStorageKey}.debug`, false);
}
}
handleShow = () => {
......@@ -86,7 +91,13 @@ class TypoModal extends Component {
// Send data to the server
async sendRequest() {
const serverUrl = config.serverUrl;
let debugMode = window.localStorage.getItem(`${config.appStorageKey}.debug`);
let serverUrl = config.serverUrl;
if (debugMode == "true") {
serverUrl = config.devServerUrl;
}
const url = window.location.href;
const data = {
......
......@@ -5,7 +5,7 @@ export const config = {
minCorrectLength: 1,
serverUrl: "//eterfund.ru/api/typos/server.php",
//serverUrl: "//ambulance.pubsandbox.eterhost.ru/typos.server/server.php",
devServerUrl: "//ambulance.pubsandbox.eterhost.ru/typos.server/server.php",
requestTimeout: 10000,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment