Skip to content

Commit

Permalink
fix(account): delete account error
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Feb 6, 2024
1 parent b299bb7 commit a2885eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,13 @@ export default class JWPAccountService extends AccountService {

logout = async () => {
try {
InPlayer.Notifications.unsubscribe();
await InPlayer.Account.signOut();
if (InPlayer.Notifications.isSubscribed()) {
InPlayer.Notifications.unsubscribe();
}

if (InPlayer.Account.isAuthenticated()) {
await InPlayer.Account.signOut();
}
} catch {
throw new Error('Failed to sign out.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const DeleteAccountModal = () => {

const deleteAccount = useMutation(accountController.deleteAccountData, {
onSuccess: async () => {
await accountController.logout();
navigate('/');
await accountController.logout();
},
onError: () => {
setEnteredPassword('');
Expand Down

0 comments on commit a2885eb

Please sign in to comment.