From 98ba0e1aa6761ed2f2ed029ff949dddec4e33b37 Mon Sep 17 00:00:00 2001 From: jarett-lee Date: Sat, 29 Sep 2018 21:02:02 -0400 Subject: [PATCH] Fixed potential race condition --- src/FirebaseAuth.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/FirebaseAuth.jsx b/src/FirebaseAuth.jsx index 17943629..e234add5 100644 --- a/src/FirebaseAuth.jsx +++ b/src/FirebaseAuth.jsx @@ -87,10 +87,11 @@ export default class FirebaseAuth extends React.Component { * @inheritDoc */ componentWillUnmount() { - return firebaseUiDeletion.then(() => { + firebaseUiDeletion = firebaseUiDeletion.then(() => { this.unregisterAuthObserver(); - firebaseUiDeletion = this.firebaseUiWidget.delete(); + return this.firebaseUiWidget.delete(); }); + return firebaseUiDeletion; } /**