Skip to content

Conversation

@buccfer
Copy link

@buccfer buccfer commented May 15, 2016

Fix the following method:

getSavedConfig: ->
            c   = undefined
            key = 'currentConfigName'

            if @hasLocalStorage()
              c ?= JSON.parse($window.localStorage.getItem(key))
            else if @hasSessionStorage()
              c ?= JSON.parse($window.sessionStorage.getItem(key))

            c ?= ipCookie(key)

            return c || defaultConfigName

When using multiple user types and sessionStorage, this method is returning always the first available config (which is incorrect if you are not using the first available config to login). The problem is that if localStorage is enabled (@hasLocalStorage() returns true) then the saved configuration will never be found in the sessionStorage due to the else clause. The issue would be resolved by removing the else clause.

I hope this helps.
By the way, the module works like a charm. Congratulations!

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant