use secureStorage on Mac
This commit is contained in:
parent
5f4eb9747e
commit
c7abf03d54
1 changed files with 2 additions and 30 deletions
|
|
@ -17,34 +17,6 @@ angular.module('copayApp.services')
|
||||||
storage = localStorageService;
|
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) {
|
var getUUID = function(cb) {
|
||||||
// TO SIMULATE MOBILE
|
// TO SIMULATE MOBILE
|
||||||
//return cb('hola');
|
//return cb('hola');
|
||||||
|
|
@ -149,7 +121,7 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
root.storeProfile = function(profile, cb) {
|
root.storeProfile = function(profile, cb) {
|
||||||
var profileString = profile.toObj();
|
var profileString = profile.toObj();
|
||||||
if (platformInfo.isNW) {
|
if (platformInfo.isNW && !platformInfo.isMac) {
|
||||||
storage.set('profile', profileString, cb);
|
storage.set('profile', profileString, cb);
|
||||||
} else {
|
} else {
|
||||||
secureStorageService.set('profile', profileString, cb);
|
secureStorageService.set('profile', profileString, cb);
|
||||||
|
|
@ -233,7 +205,7 @@ angular.module('copayApp.services')
|
||||||
* @param {getProfileCallback} cb
|
* @param {getProfileCallback} cb
|
||||||
*/
|
*/
|
||||||
root.getProfile = function(cb) {
|
root.getProfile = function(cb) {
|
||||||
if (platformInfo.isNW) {
|
if (platformInfo.isNW && !platformInfo.isMac) {
|
||||||
storage.get('profile', function(getErr, getStr) {
|
storage.get('profile', function(getErr, getStr) {
|
||||||
_onOldProfileRetrieved(getErr, getStr, cb);
|
_onOldProfileRetrieved(getErr, getStr, cb);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue