From 80e7688278877b9a88191f86c28e5c61b787a6bc Mon Sep 17 00:00:00 2001 From: iam4x Date: Wed, 30 Sep 2015 15:19:38 +0200 Subject: [PATCH 1/2] chore: add `node_modules` to `.gitignore` --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 79681bfbf..26cd5c38d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ lib umd +node_modules From c54f8efd00f6fb7e8ac69ae29c777f7d085b33ce Mon Sep 17 00:00:00 2001 From: iam4x Date: Wed, 30 Sep 2015 15:19:56 +0200 Subject: [PATCH 2/2] fix(DOMStateStorage): catch Safari incognito `QuotaExceededError` --- modules/DOMStateStorage.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/DOMStateStorage.js b/modules/DOMStateStorage.js index 5fed69d98..8e8b93be0 100644 --- a/modules/DOMStateStorage.js +++ b/modules/DOMStateStorage.js @@ -1,3 +1,5 @@ +import warning from 'warning' + /*eslint-disable no-empty */ const KeyPrefix = '@@History/' @@ -6,7 +8,14 @@ function createKey(key) { } export function saveState(key, state) { - window.sessionStorage.setItem(createKey(key), JSON.stringify(state)) + try { + window.sessionStorage.setItem(createKey(key), JSON.stringify(state)) + } catch (error) { + if (error.name === 'QuotaExceededError') + return warning(null, 'sessionStore is not accessible in incognito mode') + + throw error + } } export function readState(key) {