FIXED: variable for user storage
This commit is contained in:
1 parent
4b812349af
commit
2365fbdb9c
3 files changed
+16
-9
No files matched your search
+10
-2
@@ -122,9 +122,17 @@ function convertTimePeriodToName(pTimePeriod) {
|
||||
|
||||
window.AT_BREAKPOINT = false;
|
||||
|
||||
let testUser = window.localStorage.getItem("test_user")
|
||||
let LOGGED_IN_USER_LOCAL_STORAGE_KEY
|
||||
let LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY
|
||||
|
||||
const LOGGED_IN_USER_LOCAL_STORAGE = "xuser"
|
||||
const LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE = "xaccess_token"
|
||||
if (testUser !== null) {
|
||||
LOGGED_IN_USER_LOCAL_STORAGE_KEY = "test_user"
|
||||
LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "test_access_token"
|
||||
} else {
|
||||
LOGGED_IN_USER_LOCAL_STORAGE_KEY = "user"
|
||||
LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "access_token"
|
||||
}
|
||||
|
||||
const USDT_BTC_HTH = 19900; // This is needed to know the scale of the market time line.
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
thisObject.status = 'MIDDLE'
|
||||
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE)
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE_KEY)
|
||||
if (user !== null) { // Only if user is logged in
|
||||
thisObject.container.isDraggeable = true
|
||||
} else {
|
||||
@@ -134,7 +134,7 @@
|
||||
browserCanvasContext.closePath()
|
||||
browserCanvasContext.fill()
|
||||
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE)
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE_KEY)
|
||||
if (user !== null) { // Only if user is logged in
|
||||
arrow()
|
||||
}
|
||||
@@ -228,4 +228,3 @@
|
||||
browserCanvasContext.stroke()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ function newWorkspace () {
|
||||
|
||||
async function saveToStrategyzer () {
|
||||
try {
|
||||
const accessToken = window.localStorage.getItem(LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE)
|
||||
const accessToken = window.localStorage.getItem(LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY)
|
||||
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE)
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE_KEY)
|
||||
if (user === null) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] saveToStrategyzer -> Can not save because user is not logged in. ') }
|
||||
return
|
||||
@@ -253,9 +253,9 @@ function newWorkspace () {
|
||||
|
||||
async function loadFromStrategyzer () {
|
||||
try {
|
||||
const accessToken = window.localStorage.getItem(LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE)
|
||||
const accessToken = window.localStorage.getItem(LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY)
|
||||
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE)
|
||||
let user = window.localStorage.getItem(LOGGED_IN_USER_LOCAL_STORAGE_KEY)
|
||||
if (user === null) {
|
||||
// if there is no user that means that we are logged off, which means this object can not be used.
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user