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:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user