Returning a promise on logout and delegating login redireciton

This commit is contained in:
Bruno Alves de Faria committed 2017-09-28 08:16:23 -03:00
1 parent 0cfd02316f
commit 44fa8f0e21
2 files changed
+9 -16

No files matched your search

+8 -7
View File
@@ -1,11 +1,12 @@
import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
OHIF.user.logout = () => Meteor.logout(error => {
if (error) {
OHIF.ui.showDialog('dialogInfo', {
title: 'Error',
message: error.reason
});
}
OHIF.user.logout = () => new Promise((resolve, reject) => {
Meteor.logout(error => {
if (error) {
reject(error);
}
resolve();
});
});