mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-27 01:02:14 +05:30
Fixes ACCOUNTS-5C5. Resolve fetchAvailableApps with empty array in case when user's id is unavailable by unknown reasons.
This commit is contained in:
parent
afd6c3c300
commit
8f6ff72965
@ -40,9 +40,9 @@ function addApp(app: OauthAppResponse): AddAppAction {
|
||||
export function fetchAvailableApps() {
|
||||
return async (dispatch: Dispatch<any>, getState: () => {user: User}): Promise<void> => {
|
||||
const { id } = getState().user;
|
||||
|
||||
if (!id) {
|
||||
throw new Error('store.user.id is required for this action');
|
||||
dispatch(setAppsList([]));
|
||||
return;
|
||||
}
|
||||
|
||||
const apps = await oauth.getAppsByUser(id);
|
||||
|
Loading…
Reference in New Issue
Block a user