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

Prevents throwing errors on mobile safari #54

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

Conversation

michalzubkowicz
Copy link

On mobile safari with larger datasets this lines throws error:
QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota

On mobile safari with larger datasets this lines throws error:
QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota
@@ -1278,8 +1278,7 @@ var TAFFY, exports, T;
}
if ( settings.storageName ){
setTimeout( function () {
localStorage.setItem( 'taffy_' + settings.storageName,
JSON.stringify( TOb ) );
try { localStorage.setItem( 'taffy_' + settings.storageName, JSON.stringify( TOb ) ); } catch(Exception) {}

Choose a reason for hiding this comment

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

Can we maintain a more readable code spacing for this, like:

    try {
        localStorage.setItem( 'taffy_' + settings.storageName, 
            JSON.stringify( TOb ) ); 
    } 
    catch(Exception) {}

This will also make things easier when making changes to the same lines of code from multiple pull requests (in this case eg. https://github.com/typicaljoe/taffydb/pull/45/files)

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.

2 participants