Skip to content

Commit 8f826f0

Browse files
committed
flyout/files: take into account the setting to gray out some files
1 parent 635e9d9 commit 8f826f0

File tree

1 file changed

+7
-2
lines changed
  • src/packages/frontend/project/page/flyouts

1 file changed

+7
-2
lines changed

src/packages/frontend/project/page/flyouts/files.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ import { file_options } from "@cocalc/frontend/editor-tmp";
2929
import { FileUploadWrapper } from "@cocalc/frontend/file-upload";
3030
import { should_open_in_foreground } from "@cocalc/frontend/lib/should-open-in-foreground";
3131
import { useProjectContext } from "@cocalc/frontend/project/context";
32-
import { compute_file_masks } from "@cocalc/frontend/project/explorer/compute-file-masks";
3332
import {
3433
DirectoryListing,
3534
DirectoryListingEntry,
3635
FileMap,
3736
} from "@cocalc/frontend/project/explorer/types";
3837
import { WATCH_THROTTLE_MS } from "@cocalc/frontend/conat/listings";
38+
import { compute_file_masks } from "@cocalc/frontend/project/explorer/compute-file-masks";
3939
import { mutate_data_to_compute_public_files } from "@cocalc/frontend/project_store";
4040
import track from "@cocalc/frontend/user-tracking";
4141
import {
@@ -126,6 +126,8 @@ export function FilesFlyout({
126126
const hidden = useTypedRedux({ project_id }, "show_hidden");
127127
const checked_files = useTypedRedux({ project_id }, "checked_files");
128128
const openFiles = useTypedRedux({ project_id }, "open_files_order");
129+
const otherSettings = useTypedRedux("account", "other_settings");
130+
const maskFiles = otherSettings?.get("mask_files");
129131
// mainly controls what a single click does, plus additional UI elements
130132
const [mode, setMode] = useState<"open" | "select">("open");
131133
const [prevSelected, setPrevSelected] = useState<number | null>(null);
@@ -190,7 +192,9 @@ export function FilesFlyout({
190192
const files: DirectoryListing | null = filesStore.toJS?.();
191193
if (files == null) return EMPTY_LISTING;
192194
let activeFile: DirectoryListingEntry | null = null;
193-
compute_file_masks(files);
195+
if (maskFiles) {
196+
compute_file_masks(files);
197+
}
194198
const searchWords = search_split(file_search.trim().toLowerCase());
195199

196200
const procFiles = files
@@ -295,6 +299,7 @@ export function FilesFlyout({
295299
openFiles,
296300
current_path,
297301
strippedPublicPaths,
302+
maskFiles,
298303
]);
299304

300305
const prev_current_path = usePrevious(current_path);

0 commit comments

Comments
 (0)