1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

fix callbacks for user service methods

This commit is contained in:
Kyle Spearrin
2017-11-03 15:40:19 -04:00
parent 2211c569d7
commit e3dea4084f
6 changed files with 32 additions and 31 deletions

View File

@@ -21,7 +21,7 @@ function initSyncService() {
var self = this;
self.syncStarted();
self.userService.isAuthenticated(function (isAuthenticated) {
self.userService.isAuthenticated().then(function (isAuthenticated) {
if (!isAuthenticated) {
self.syncCompleted(false);
callback(false);

View File

@@ -31,7 +31,6 @@ export default class UserService {
return UtilsService.saveObjToStorage(Keys.stamp, stamp);
}
// TODO: callbacks
async getUserId(): Promise<string> {
if (this.userId != null) {
return this.userId;
@@ -41,7 +40,6 @@ export default class UserService {
return this.userId;
}
// TODO: callbacks
async getEmail(): Promise<string> {
if (this.email != null) {
return this.email;
@@ -70,7 +68,6 @@ export default class UserService {
this.userId = this.email = this.stamp = null;
}
// TODO: fix callbacks
async isAuthenticated(): Promise<boolean> {
const token = await this.tokenService.getToken();
if (token == null) {