Skip to content

Commit

Permalink
Merge pull request #4191 from marmelab/Fix-temporal-dead-zone-in-useG…
Browse files Browse the repository at this point in the history
…etPermissions

Fix ReferenceError in useGetPermissions due to temporal dead zone
  • Loading branch information
djhi authored Dec 19, 2019
2 parents 66e3eeb + c31e589 commit ce20601
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ra-core/src/auth/useGetPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useCallback } from 'react';

import useAuthProvider from './useAuthProvider';

const getPermissionsWithoutProvider = () => Promise.resolve([]);

/**
* Get a callback for calling the authProvider.getPermissions() method.
*
Expand Down Expand Up @@ -43,8 +45,6 @@ const useGetPermissions = (): GetPermissions => {
return authProvider ? getPermissions : getPermissionsWithoutProvider;
};

const getPermissionsWithoutProvider = () => Promise.resolve([]);

/**
* Proxy for calling authProvider.getPermissions()
*
Expand Down

0 comments on commit ce20601

Please sign in to comment.