Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies #2378

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Bump dependencies #2378

merged 1 commit into from
Feb 27, 2024

Conversation

SleeplessOne1917
Copy link
Member

No description provided.

@SleeplessOne1917 SleeplessOne1917 merged commit eb5095b into main Feb 27, 2024
0 of 2 checks passed
@SleeplessOne1917 SleeplessOne1917 deleted the dep-bump branch February 27, 2024 00:16
@matc-pub
Copy link
Collaborator

The new lemmy-js-client version returns an error in the browser for HttpService.client.getPosts(..):

TypeError: 'fetch' called on an object that does not implement interface Window.

This change gets things working again:

diff --git a/src/shared/services/HttpService.ts b/src/shared/services/HttpService.ts
index 7ff9121b..390d446e 100644
--- a/src/shared/services/HttpService.ts
+++ b/src/shared/services/HttpService.ts
@@ -84,7 +84,9 @@ export class HttpService {
   #client: WrappedLemmyHttp;
 
   private constructor() {
-    const lemmyHttp = new LemmyHttp(getHttpBase());
+    const lemmyHttp = new LemmyHttp(getHttpBase(), {
+      fetchFunction: window?.fetch.bind(window),
+    });
     this.#client = wrapClient(lemmyHttp);
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants