Skip to content

Commit

Permalink
Disable suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmarete committed Feb 4, 2025
1 parent 1c30118 commit 07ac71b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/groups/Members/NewMemberModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const NewMemberModal = (props: NewMemberModalProps) => {

const signal = useCancellation();

const enableShareLog = false; // Set "true" to enable suggestions

useOnMount(() => {
const loadData = withErrorReporting('Error looking up collaborators')(async () => {
const [shareSuggestions, groups] = await Promise.all([Workspaces(signal).getShareLog(), Groups(signal).list()]);
Expand All @@ -52,7 +54,7 @@ export const NewMemberModal = (props: NewMemberModalProps) => {

setSuggestions(suggestions);
});
loadData();
enableShareLog && loadData();
});

const submit = async () => {
Expand Down
4 changes: 3 additions & 1 deletion src/workspaces/ShareWorkspaceModal/ShareWorkspaceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const ShareWorkspaceModal: React.FC<ShareWorkspaceModalProps> = (props: ShareWor

const signal = useCancellation();

const enableShareLog = false; // Set "true" to enable suggestions

// Lifecycle
useOnMount(() => {
const load = async () => {
Expand Down Expand Up @@ -100,7 +102,7 @@ const ShareWorkspaceModal: React.FC<ShareWorkspaceModalProps> = (props: ShareWor
_.uniq
)(groups);

const remainingSuggestions = _.difference(suggestions, _.map('email', acl));
const remainingSuggestions = enableShareLog ? _.difference(suggestions, _.map('email', acl)) : [];
const addUserReminder =
'Did you mean to add collaborators? Add them or clear the "User emails" field to save changes.';

Expand Down

0 comments on commit 07ac71b

Please sign in to comment.