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

Connection timeout after 3000 on windows phone #108

Open
pascalpascal247 opened this issue Aug 2, 2016 · 0 comments
Open

Connection timeout after 3000 on windows phone #108

pascalpascal247 opened this issue Aug 2, 2016 · 0 comments

Comments

@pascalpascal247
Copy link

Hi,

I am trying to get ydn-db working on my Windows phone, but I get a connection timeout everytime I start the application. When I place the initDatabase code outside Angular, the timeout error does not occur. Does anyone know why this problem is happening and how to fix it?

PS: On Android, iPhone, Google chrome etc. it's working fine.

ydn-database


angular.module('example')
.factory('exampleDB', function($q, $window) {

var exampledb;

function initDatabase(){
   var scheme = {
     version: 1,
     stores: [{
     name: 'exampledb',
     keyPath: 'id'
   }]};

  exampledb= new ydn.db.Storage('exampledb', scheme);

  exampledb.addEventListener('ready', function(ev) {

          if (isNaN(ev.getOldVersion())) {
            // new database is created
            loaded = true;
            deferred.resolve(true);
          } else if (ev.getVersion() > ev.getOldVersion()) {
            // schema upgrade, do data upgrade as necessary
          } else {
            loaded = true;
            deferred.resolve(true);
          }
   });

  exampledb.addEventListener('fail', function(ev) {
            var err = ev.getError();
            console.log(err);
  });
}

......

});
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

No branches or pull requests

1 participant