Skip to content

Commit

Permalink
Import, lint, typecheck cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwhelchel committed Jan 11, 2024
1 parent 80e6c68 commit 25509b4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
31 changes: 16 additions & 15 deletions packages/desktop-client/src/components/modals/CreateAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ export function CreateAccount({
}
};

type NormalizedAccount = {
account_id: string;
name: string;
institution: string;
orgDomain: string;
};

const onConnectSimpleFin = async () => {
if (!isSimpleFinSetupComplete) {
onSimpleFinInit();
Expand All @@ -71,15 +64,23 @@ export function CreateAccount({

const newAccounts = [];

for (let i = 0; i < results.accounts.accounts.length; i++) {
const oldAccount = results.accounts.accounts[i];
const newAccount = {};
newAccount.account_id = oldAccount.id;
newAccount.name = oldAccount.name;
newAccount.institution = {
name: oldAccount.org.name,
type NormalizedAccount = {
account_id: string;
name: string;
institution: string;
orgDomain: string;
};

for (let i = 0; i < results.accounts.length; i++) {
const oldAccount = results.accounts[i];

const newAccount: NormalizedAccount = {
account_id: oldAccount.id,
name: oldAccount.name,
institution: oldAccount.org.name,
orgDomain: oldAccount.org.domain,
};
newAccount.orgDomain = oldAccount.org.domain;

newAccounts.push(newAccount);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { send } from 'loot-core/src/platform/client/fetch';

import { Error } from '../alerts';
import { ButtonWithLoading } from '../common/Button';
import ExternalLink from '../common/ExternalLink';
import Input from '../common/Input';
import Modal, { ModalButtons } from '../common/Modal';
import { ExternalLink } from '../common/ExternalLink';
import { Input } from '../common/Input';
import { Modal, ModalButtons } from '../common/Modal';
import type { ModalProps } from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';
import { Text } from '../common/Text';
import { View } from '../common/View';
import { FormField, FormLabel } from '../forms';

type SimpleFinInitialiseProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/hooks/useSimpleFinStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';

import { send } from 'loot-core/src/platform/client/fetch';

import useSyncServerStatus from './useSyncServerStatus';
import { useSyncServerStatus } from './useSyncServerStatus';

export function useSimpleFinStatus() {
const [configuredSimpleFin, setConfiguredSimpleFin] = useState<
Expand Down
2 changes: 1 addition & 1 deletion packages/loot-core/src/types/models/simplefin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export type SimpleFinAccount = {
id: string;
name: string;
org: SimpleFinOrganization;
};
};

0 comments on commit 25509b4

Please sign in to comment.