Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get item from localStorage only when the cache is enabled #351

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LouaiTrabulsi
Copy link

I need to use the chatbot in an environment that doesn't support localStorage.
I saw you are using localStorage for caching purpose, for my case I don't need cache so I leave it as default (disabled), but I realized that in file 'storage.js' you are accessing the localStorage before checking if the cache is enabled:
const unParsedCache = localStorage.getItem(cacheName);
so I just moved this line to be after checking if cache is enbled:

if (cache) {
    const unParsedCache = localStorage.getItem(cacheName);
    if (unParsedCache) {

this way I will not get an error related to localStorage in my environment.
Thanks in advance

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.

None yet

2 participants