From 285859682b0bd8fa5410501834f964b9b6176694 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Apr 2019 21:24:27 +0200 Subject: [PATCH] Working with AAWeb and Azure as Storage Providers --- Globals.js | 32 +++++++++++++++++--------------- TimeMachine.js | 5 +++++ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Globals.js b/Globals.js index 127b81a9d..08ed4c5b7 100644 --- a/Globals.js +++ b/Globals.js @@ -1,5 +1,20 @@ /* User Interface Colors */ +const STORAGE_PROVIDER = 'AAWeb'; + +const SUPPORTED_EXCHANGES = ["Poloniex"]; +const SUPPORTED_MARKETS = [ + { + assetA: "USDT", + assetB: "BTC", + } +]; +const DEFAULT_EXCHANGE = "Poloniex"; +const DEFAULT_MARKET = { + assetA: "USDT", + assetB: "BTC", +}; + UI_COLOR = { DARK: "48, 48, 54", LIGHT: "234, 226, 222", @@ -94,20 +109,7 @@ function convertTimePeriodToName(pTimePeriod) { window.AT_BREAKPOINT = false; -const SUPPORTED_EXCHANGES = ["Poloniex", "Coss"]; -const SUPPORTED_MARKETS = [ - { - assetA: "USDT", - assetB: "BTC", - } -]; -const DEFAULT_EXCHANGE = "Coss"; -const DEFAULT_MARKET = { - assetA: "USDT", - assetB: "BTC", -}; - -const USDT_BTC_HTH = 19900; // This is needed to know the scale of the market time line. +const USDT_BTC_HTH = 19900; // This is needed to know the scale of the market time line. const WIDHTER_VOLUME_BAR_BASE_FACTOR = 2.5; const LESS_WIDHTER_VOLUME_BAR_TOP_FACTOR = 1 / 4; @@ -174,4 +176,4 @@ const CHART_SPACE_HEIGHT = browserCanvas.height * 100; function toRadians(angle) { return angle * (Math.PI / 180); -} \ No newline at end of file +} diff --git a/TimeMachine.js b/TimeMachine.js index 29312f0b7..492397d7d 100644 --- a/TimeMachine.js +++ b/TimeMachine.js @@ -106,6 +106,11 @@ function newTimeMachine () { let leftToInitialize = SUPPORTED_EXCHANGES.length * SUPPORTED_MARKETS.length - 1 // The default exchange and market was already initialized. let alreadyInitialized = 0 + if (alreadyInitialized === leftToInitialize) { + callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE) + return + } + for (let i = 0; i < SUPPORTED_EXCHANGES.length; i++) { for (let j = 0; j < SUPPORTED_MARKETS.length; j++) { let exchange = SUPPORTED_EXCHANGES[i]