Skip to content

Commit

Permalink
Merge pull request #268 from powerhouse-inc/feat-allow-empty-string-a…
Browse files Browse the repository at this point in the history
…llow-list

feat: allow empty string allow list
  • Loading branch information
ryanwolhuter authored Apr 24, 2024
2 parents 8c03646 + 0099615 commit ef3cbc6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/hooks/useIsAllowedToCreateDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ export function useIsAllowedToCreateDocuments() {
const createDocumentAllowListEnvString = import.meta.env
.VITE_CREATE_DOCUMENT_ALLOW_LIST;

const createDocumentAllowList =
createDocumentAllowListEnvString?.split(',');
if (createDocumentAllowList === undefined) {
if (
createDocumentAllowListEnvString === undefined ||
createDocumentAllowListEnvString === ''
) {
return true;
}

const createDocumentAllowList = createDocumentAllowListEnvString.split(',');
if (createDocumentAllowList.length === 0) {
return true;
}

Expand Down

0 comments on commit ef3cbc6

Please sign in to comment.