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 { ...@@ -37,6 +37,11 @@ class TypoModal extends Component {
// Bindings // Bindings
this.submitTypo = this.submitTypo.bind(this); this.submitTypo = this.submitTypo.bind(this);
if (!window.localStorage.getItem(`${config.appStorageKey}.debug`)) {
window.localStorage.setItem(`${config.appStorageKey}.debug`, false);
}
} }
handleShow = () => { handleShow = () => {
...@@ -86,7 +91,13 @@ class TypoModal extends Component { ...@@ -86,7 +91,13 @@ class TypoModal extends Component {
// Send data to the server // Send data to the server
async sendRequest() { 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 url = window.location.href;
const data = { const data = {
......
...@@ -4,9 +4,9 @@ export const config = { ...@@ -4,9 +4,9 @@ export const config = {
maxCorrectLength: 50, maxCorrectLength: 50,
minCorrectLength: 1, minCorrectLength: 1,
serverUrl: "//eterfund.ru/api/typos/server.php", 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, requestTimeout: 10000,
defaultLanguage: "ru", defaultLanguage: "ru",
......
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