Skip to content

Commit 0efadaf

Browse files
authored
fix: avoid requesting app settings if the client isn't connected (#1779)
1 parent 11bbe74 commit 0efadaf

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

package/src/components/Chat/hooks/__tests__/useAppSettings.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ describe('useAppSettings', () => {
1818
auto_translation_enabled: true,
1919
}),
2020
),
21+
userID: 'some-user-id',
2122
} as unknown as StreamChat,
2223
isOnline,
2324
);

package/src/components/Chat/hooks/useAppSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const useAppSettings = <
2626
}
2727
}
2828

29-
if (isOnline) {
29+
if (isOnline && client.userID) {
3030
getAppSettings();
3131
}
3232

0 commit comments

Comments
 (0)