Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot b12dd9a3b8 chore(release): 0.2.0-develop.29 [skip ci]
# [0.2.0-develop.29](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.28...v0.2.0-develop.29) (2023-08-10)

### Bug Fixes

* handle localStorage being undefined ([0ab6cf0](0ab6cf0ff0))
2023-08-10 06:13:05 +00:00
Derrick Hammer 9d153cde40
Merge remote-tracking branch 'origin/develop' into develop 2023-08-10 02:11:56 -04:00
Derrick Hammer 0ab6cf0ff0
fix: handle localStorage being undefined 2023-08-10 02:11:50 -04:00
4 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,10 @@
# [0.2.0-develop.29](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.28...v0.2.0-develop.29) (2023-08-10)
### Bug Fixes
* handle localStorage being undefined ([0ab6cf0](https://git.lumeweb.com/LumeWeb/libweb/commit/0ab6cf0ff095209f0a4d83c4295ecd5558de8a89))
# [0.2.0-develop.28](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.27...v0.2.0-develop.28) (2023-08-10)
# [0.2.0-develop.27](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.26...v0.2.0-develop.27) (2023-07-21)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.28",
"version": "0.2.0-develop.29",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.28",
"version": "0.2.0-develop.29",
"dependencies": {
"@lumeweb/community-portals": "^0.1.0-develop.6",
"@lumeweb/libportal": "0.2.0-develop.17",

View File

@ -1,6 +1,6 @@
{
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.28",
"version": "0.2.0-develop.29",
"main": "lib/index.js",
"type": "module",
"repository": {

View File

@ -120,11 +120,17 @@ export function savePortals() {
url: item.portalUrl,
} as Portal;
});
window.localStorage.setItem("portals", JSON.stringify(portals));
if (typeof globalThis.localStorage !== "undefined") {
globalThis.localStorage.setItem("portals", JSON.stringify(portals));
}
}
export function loadSavedPortals(): Portal[] | null {
let portals = window.localStorage.getItem("portals");
let portals: string | null = null;
if (typeof globalThis.localStorage !== "undefined") {
portals = globalThis.localStorage.getItem("portals");
}
if (!portals) {
return null;