Let background page instantiate AccountManagers

Remove the need to expose the server url config as a global.

// FREEBIE
This commit is contained in:
lilia 2015-09-01 12:57:02 -07:00
parent edd76ec65a
commit e626355e0c
3 changed files with 8 additions and 5 deletions

View file

@ -62,6 +62,12 @@
return -1;
}
};
window.getAccountManager = function() {
var USERNAME = storage.get('number_id');
var PASSWORD = storage.get('password');
return new textsecure.AccountManager(SERVER_URL, USERNAME, PASSWORD);
};
storage.fetch();
storage.onready(function() {
setUnreadCount(storage.get("unreadCount", 0));
@ -74,8 +80,6 @@
init(true);
});
window.TEXT_SECURE_SERVER_URL = 'https://textsecure-service-staging.whispersystems.org';
if (open) {
openInbox();
}