no file storage from WP

This commit is contained in:
Matias Alejo Garcia 2015-04-26 11:41:25 -03:00
commit 7f6b41e11d
8 changed files with 46 additions and 13 deletions

View file

@ -1,9 +1,16 @@
'use strict';
angular.module('copayApp.services')
.factory('storageService', function(fileStorageService, localStorageService, sjcl, $log, lodash, isCordova) {
.factory('storageService', function(logHeader, fileStorageService, localStorageService, sjcl, $log, lodash, isCordova) {
var root = {};
var storage = isCordova ? fileStorageService : localStorageService;
// File storage is not supported for writting according to
// https://github.com/apache/cordova-plugin-file/#supported-platforms
var shouldUseFileStorage = isCordova && !isMobile.Windows();
$log.debug('Using file storage:', shouldUseFileStorage);
var storage = shouldUseFileStorage ? fileStorageService : localStorageService;
var getUUID = function(cb) {
// TO SIMULATE MOBILE
@ -50,7 +57,7 @@ angular.module('copayApp.services')
root.tryToMigrate = function(cb) {
if (!isCordova) return cb();
if (!shouldUseFileStorage) return cb();
localStorageService.get('profile', function(err, str) {
if (err) return cb(err);