From c31e5890ec2e51fcd2b01037604c31276a2b332c Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Thu, 19 Dec 2019 10:59:02 +0100 Subject: [PATCH] Fix ReferenceError in useGetPermissions due to temporal dead zone Closes #4184 --- packages/ra-core/src/auth/useGetPermissions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ra-core/src/auth/useGetPermissions.ts b/packages/ra-core/src/auth/useGetPermissions.ts index 51f028379f..9431a80e1f 100644 --- a/packages/ra-core/src/auth/useGetPermissions.ts +++ b/packages/ra-core/src/auth/useGetPermissions.ts @@ -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. * @@ -43,8 +45,6 @@ const useGetPermissions = (): GetPermissions => { return authProvider ? getPermissions : getPermissionsWithoutProvider; }; -const getPermissionsWithoutProvider = () => Promise.resolve([]); - /** * Proxy for calling authProvider.getPermissions() *