LargeLocalStorage icon indicating copy to clipboard operation
LargeLocalStorage copied to clipboard

Can anyone get this library to work?

Open chrisspen opened this issue 5 years ago • 0 comments

I realize this project was abandoned years ago, but has anyone been able to get it to work?

I can't even get the storage initialization code to run. If I do something like:

var requestedBytes = 1024*1024*10; // MB

$(document).ready(function(){

    // Create a key-value store
    var storage = new LargeLocalStorage({size: requestedBytes, name: 'mydb'});

    // Await initialization of the storage area
    console.log('initializing storage')
    storage.initialized.then(function(grantedCapacity){
        // Check to see how much space the user authorized us to actually use.
        // Some browsers don't indicate how much space was granted in which case
        // grantedCapacity will be 1.
        if (grantedCapacity != -1 && grantedCapacity != requestedBytes) {
            console.log('error granting full capacity');
        }else{
            console.log('storage granted!')
        }
    });

});

and run it in a recent version of Chrome, the console shows initializing storage, but it never shows any of the log messages for when the storage is finished initializing, implying it never runs.

It looks like grantedCapacity is no longer an integer, but some sort of Object.

chrisspen avatar Jul 18 '20 23:07 chrisspen