Skip to content

Commit

Permalink
feat: Add react-script required prefix to permissions env var
Browse files Browse the repository at this point in the history
  • Loading branch information
almeida1492 committed Sep 28, 2023
1 parent d45ab80 commit a6bc6f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_USE_MOCK_API=
ENABLE_PERMISSIONS=true
REACT_APP_ENABLE_PERMISSIONS=true
3 changes: 2 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_USE_MOCK_API=true
REACT_APP_USE_MOCK_API=true
REACT_APP_ENABLE_PERMISSIONS=true
2 changes: 1 addition & 1 deletion src/libraries/permissionUtils/usePermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { usePermissions } from "./usePermissions";
*/
export const usePermission = (name: TPermission): boolean => {
const permissions = usePermissions();
if (!process.env.ENABLE_PERMISSIONS) {
if (!process.env.REACT_APP_ENABLE_PERMISSIONS) {
return true;
}
return Boolean(permissions.find((permission: string) => permission === name));
Expand Down

0 comments on commit a6bc6f6

Please sign in to comment.