I have this effect for logout confirmation under the condition of a dialog response, but am getting the following errors:
ERROR Error: Effect "AuthEffects.logoutConfirmation$" dispatched an invalid action: undefined
and
ERROR TypeError: Actions must be objects
heres the effect:
@Effect()
logoutConfirmation$ = this.actions$
.ofType<Logout>(AuthActionTypes.Logout)
.pipe(
map(action => {
if (action.confirmationDialog) {
this.dialogService
.open(LogoutPromptComponent)
.afterClosed()
.pipe(
map(confirmed => {
if (confirmed) {
return new LogoutConfirmed();
} else {
return new LogoutCancelled();
}
})
);
} else {
return new LogoutConfirmed();
}
})
);
it works when confirmation dialog is activated, I guess it's something wrong with the map of the dialog's response, have been trying to understand it but couldn't fin a way. Any one has a clue on this?
return this.dialogService //etc...- korteeelogoutConfirmation$aslogoutConfirmation$:Observable<Action>and see what happens ;) - Jota.Toledo