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

fix: fix history state #60

Merged
merged 3 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"lint": "eslint src",
"jsdoc": "rm -rf ./doc && jsdoc -c jsdoc.json",
"coverage": "karma start --coverage",
"test:node": "node ./dist/persist.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be confusion because the term test is generally used as a command or prefix to run unit/e2e test.
The purpose is to simply determine whether there is a problem with initialization when the module is executed in node env.
I think names like simulate:node, emulate:node would be more appropriate.

"release": "node config/release.js",
"demo:start": "npm run demo:prebuild-latest && npm run demo:updateVersion && jekyll serve --host=0.0.0.0 -s demo",
"demo:build": "npm run demo:updateVersion && jekyll build -s demo",
Expand Down
2 changes: 1 addition & 1 deletion src/storageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const storage = (function() {
} else if (isStorageAvailable(localStorage)) {
strg = localStorage;
storageType = "LocalStorage";
} else if (history.state) {
} else if (history && history.state) {
storageType = "History";
}

Expand Down