Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 20144b1

Browse files
committed
Clean types
1 parent 28d8ab1 commit 20144b1

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ecency/sdk",
33
"private": false,
4-
"version": "1.0.53",
4+
"version": "1.0.54",
55
"type": "module",
66
"license": "MIT",
77
"main": "./dist/ecency-sdk.umd.js",
Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
import { queryOptions } from "@tanstack/react-query";
22
import { CONFIG } from "@/modules/core";
3+
import { CommunityRole } from "../types";
34

45
export function getCommunityContextQueryOptions(
5-
username: string | undefined,
6-
communityName: string | undefined
6+
username: string | undefined,
7+
communityName: string | undefined
78
) {
8-
return queryOptions({
9-
queryKey: ["community", "context", username, communityName],
10-
enabled: !!username && !!communityName,
11-
queryFn: async () => {
12-
const response = await CONFIG.hiveClient.call("bridge", "get_community_context", {
13-
account: username,
14-
name: communityName,
15-
});
9+
return queryOptions({
10+
queryKey: ["community", "context", username, communityName],
11+
enabled: !!username && !!communityName,
12+
queryFn: async () => {
13+
const response = await CONFIG.hiveClient.call(
14+
"bridge",
15+
"get_community_context",
16+
{
17+
account: username,
18+
name: communityName,
19+
}
20+
);
1621

17-
return {
18-
role: response?.role ?? "guest",
19-
subscribed: response?.subscribed ?? false,
20-
};
21-
},
22-
});
22+
return {
23+
role: response?.role ?? "guest",
24+
subscribed: response?.subscribed ?? false,
25+
} satisfies {
26+
role: CommunityRole;
27+
subscribed: boolean;
28+
};
29+
},
30+
});
2331
}

0 commit comments

Comments
 (0)