Skip to content

Commit

Permalink
Fix send types in a number of places
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdoming committed Jan 21, 2025
1 parent c17b83e commit 84fd2b8
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions packages/desktop-client/src/components/modals/EditAccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Trans, useTranslation } from 'react-i18next';
import { addNotification, popModal, signOut } from 'loot-core/client/actions';
import { send } from 'loot-core/platform/client/fetch';
import { getUserAccessErrors } from 'loot-core/shared/errors';
import { type Handlers } from 'loot-core/types/handlers';
import { type UserAccessEntity } from 'loot-core/types/models/userAccess';

import { useDispatch } from '../../redux';
Expand Down Expand Up @@ -34,22 +33,20 @@ export function EditUserAccess({
const [availableUsers, setAvailableUsers] = useState<[string, string][]>([]);

useEffect(() => {
send('access-get-available-users', defaultUserAccess.fileId).then(
(data: Awaited<ReturnType<Handlers['access-get-available-users']>>) => {
if ('error' in data) {
setSetError(data.error);
} else {
setAvailableUsers(
data.map(user => [
user.userId,
user.displayName
? `${user.displayName} (${user.userName})`
: user.userName,
]),
);
}
},
);
send('access-get-available-users', defaultUserAccess.fileId).then(data => {
if ('error' in data) {
setSetError(data.error);
} else {
setAvailableUsers(
data.map(user => [
user.userId,
user.displayName
? `${user.displayName} (${user.userName})`
: user.userName,
]),
);
}
});
}, [defaultUserAccess.fileId]);

async function onSave(close: () => void) {
Expand Down

0 comments on commit 84fd2b8

Please sign in to comment.