From c7abf03d54ac119a7b5365aa3ceae07b1cc820bb Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 27 Jun 2018 16:52:50 +0200 Subject: [PATCH] use secureStorage on Mac --- src/js/services/storageService.js | 32 ++----------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index 4b7adb7d5..8f1317f5d 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -17,34 +17,6 @@ angular.module('copayApp.services') storage = localStorageService; } - /* migration script */ - // var migratingProfile = false; - // if (isNW) { - // $log.debug('NW.js app, checking if profile migration is needed..'); - // profileStorage = desktopSecureStorageService; - // migratingProfile = true; - // storage.get('profile', function(err, str) { - // if (err || !str) - // $log.warn(err); - // - // if (str) { - // $log.debug("Local Storage found.. Migration is needed.."); - // $log.debug("Trying to migrate profile!"); - // console.log(str); - // profileStorage.set('profile', str, function(err) { - // if (err) - // $log.warn(err); - // //else - // //storage.remove('profile', function() {}) - // }); - // - // } else { - // $log.debug("Local Storage not found.. skipping migration.."); - // } - // migratingProfile = false; - // }); - // } - var getUUID = function(cb) { // TO SIMULATE MOBILE //return cb('hola'); @@ -149,7 +121,7 @@ angular.module('copayApp.services') root.storeProfile = function(profile, cb) { var profileString = profile.toObj(); - if (platformInfo.isNW) { + if (platformInfo.isNW && !platformInfo.isMac) { storage.set('profile', profileString, cb); } else { secureStorageService.set('profile', profileString, cb); @@ -233,7 +205,7 @@ angular.module('copayApp.services') * @param {getProfileCallback} cb */ root.getProfile = function(cb) { - if (platformInfo.isNW) { + if (platformInfo.isNW && !platformInfo.isMac) { storage.get('profile', function(getErr, getStr) { _onOldProfileRetrieved(getErr, getStr, cb); });