Skip to content

Commit cb52373

Browse files
Rename loot-core/platform/client/fetch to connection to match server-side package (#6943)
* Rename loot-core/platform/client/fetch package to connection to match the server side package name. Also to avoid confusion with the native fetch package. * Update connection/init method to not receive any parameter to so browser and default implementation have the same signature * Add release notes for PR #6943 * Fix names * Fix imports --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 68bb33e commit cb52373

File tree

138 files changed

+162
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+162
-149
lines changed

packages/desktop-client/src/accounts/accountsSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
22
import type { PayloadAction } from '@reduxjs/toolkit';
33
import memoizeOne from 'memoize-one';
44

5-
import { send } from 'loot-core/platform/client/fetch';
5+
import { send } from 'loot-core/platform/client/connection';
66
import type { SyncResponseWithErrors } from 'loot-core/server/accounts/app';
77
import { groupById } from 'loot-core/shared/util';
88
import type {

packages/desktop-client/src/app/appSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createAction, createSlice } from '@reduxjs/toolkit';
22
import type { PayloadAction } from '@reduxjs/toolkit';
33

4-
import { send } from 'loot-core/platform/client/fetch';
4+
import { send } from 'loot-core/platform/client/connection';
55
import { getUploadError } from 'loot-core/shared/errors';
66
import type { AccountEntity } from 'loot-core/types/models';
77
import type { AtLeastOne } from 'loot-core/types/util';

packages/desktop-client/src/budget/mutations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type { QueryClient, QueryKey } from '@tanstack/react-query';
55
import type { TFunction } from 'i18next';
66
import { v4 as uuidv4 } from 'uuid';
77

8-
import { sendCatch } from 'loot-core/platform/client/fetch';
9-
import type { send } from 'loot-core/platform/client/fetch';
8+
import { sendCatch } from 'loot-core/platform/client/connection';
9+
import type { send } from 'loot-core/platform/client/connection';
1010
import { logger } from 'loot-core/platform/server/log';
1111
import type { IntegerAmount } from 'loot-core/shared/util';
1212
import type {

packages/desktop-client/src/budget/queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { queryOptions } from '@tanstack/react-query';
22
import i18n from 'i18next';
33

4-
import { send } from 'loot-core/platform/client/fetch';
4+
import { send } from 'loot-core/platform/client/connection';
55
import type {
66
CategoryEntity,
77
CategoryGroupEntity,

packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
22
import type { PayloadAction } from '@reduxjs/toolkit';
33
import { t } from 'i18next';
44

5-
import { send } from 'loot-core/platform/client/fetch';
5+
import { send } from 'loot-core/platform/client/connection';
66
import type { RemoteFile } from 'loot-core/server/cloud-storage';
77
import { getDownloadError, getSyncError } from 'loot-core/shared/errors';
88
import type { Budget } from 'loot-core/types/budget';

packages/desktop-client/src/components/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import { styles } from '@actual-app/components/styles';
1212
import { View } from '@actual-app/components/view';
1313
import { useQueryClient } from '@tanstack/react-query';
1414

15-
import { init as initConnection, send } from 'loot-core/platform/client/fetch';
15+
import {
16+
init as initConnection,
17+
send,
18+
} from 'loot-core/platform/client/connection';
1619

1720
import { AppBackground } from './AppBackground';
1821
import { BudgetMonthCountProvider } from './budget/BudgetMonthCountContext';
@@ -73,18 +76,15 @@ function AppInner() {
7376
};
7477

7578
async function init() {
76-
const serverSocket = await maybeUpdate(() =>
77-
global.Actual.getServerSocket(),
78-
);
79-
79+
await maybeUpdate();
8080
dispatch(
8181
setAppState({
8282
loadingText: t(
8383
'Initializing the connection to the local database...',
8484
),
8585
}),
8686
);
87-
await initConnection(serverSocket);
87+
await initConnection();
8888

8989
// Load any global prefs
9090
dispatch(

packages/desktop-client/src/components/LoggedInUser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Text } from '@actual-app/components/text';
1111
import { theme } from '@actual-app/components/theme';
1212
import { View } from '@actual-app/components/view';
1313

14-
import { listen } from 'loot-core/platform/client/fetch';
14+
import { listen } from 'loot-core/platform/client/connection';
1515
import type { RemoteFile, SyncedLocalFile } from 'loot-core/types/file';
1616
import type { TransObjectLiteral } from 'loot-core/types/util';
1717

packages/desktop-client/src/components/ManageRules.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Text } from '@actual-app/components/text';
1010
import { theme } from '@actual-app/components/theme';
1111
import { View } from '@actual-app/components/view';
1212

13-
import { send } from 'loot-core/platform/client/fetch';
13+
import { send } from 'loot-core/platform/client/connection';
1414
import * as undo from 'loot-core/platform/client/undo';
1515
import { getNormalisedString } from 'loot-core/shared/normalisation';
1616
import { q } from 'loot-core/shared/query';

packages/desktop-client/src/components/Modals.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React, { Fragment, useEffect, useEffectEvent } from 'react';
33
import { useLocation } from 'react-router';
44

5-
import { send } from 'loot-core/platform/client/fetch';
5+
import { send } from 'loot-core/platform/client/connection';
66
import * as monthUtils from 'loot-core/shared/months';
77

88
import { EditSyncAccount } from './banksync/EditSyncAccount';

packages/desktop-client/src/components/NotesButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Tooltip } from '@actual-app/components/tooltip';
1010
import { View } from '@actual-app/components/view';
1111
import { css, cx } from '@emotion/css';
1212

13-
import { send } from 'loot-core/platform/client/fetch';
13+
import { send } from 'loot-core/platform/client/connection';
1414

1515
import { Notes } from './Notes';
1616

0 commit comments

Comments
 (0)