Skip to content

Commit

Permalink
docs: Explain hardcoded const
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Feb 9, 2024
1 parent f0c0932 commit 22db80b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,13 @@ export const previewStore: StateCreator<
},

requestedFiles: () => {
// Importing PASSPORT_REQUESTED_FILES_KEY causes tests to fail - possible circular dependency issue?
// Repeating it here so find and replace still points to this hardcoded value
const PASSPORT_REQUESTED_FILES_KEY = "_requiredFiles";

const { computePassport } = get();
const currentRequestedFiles = computePassport().data?._requestedFiles;
const currentRequestedFiles =
computePassport().data?.[PASSPORT_REQUESTED_FILES_KEY];
const emptyFileList = { required: [], recommended: [], optional: [] };

return currentRequestedFiles || emptyFileList;
Expand Down

0 comments on commit 22db80b

Please sign in to comment.