@ecency/sdk 1.0.47 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,7 +75,7 @@ const f = (e) => {
75
75
  return;
76
76
  }
77
77
  }, l = (e) => f(e) && f(e).accessToken, K = (e) => f(e) && f(e).postingKey, S = (e) => f(e) && f(e).loginType, Z = (e) => f(e) && f(e).refreshToken;
78
- function J() {
78
+ function M() {
79
79
  return new Promise((e) => {
80
80
  var t;
81
81
  (t = window.hive_keychain) == null || t.requestHandshake(() => {
@@ -97,9 +97,9 @@ const g = (e, t, n, o = null) => new Promise((i, c) => {
97
97
  }), L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
98
98
  __proto__: null,
99
99
  broadcast: g,
100
- handshake: J
100
+ handshake: M
101
101
  }, Symbol.toStringTag, { value: "Module" }));
102
- function M(e = [], t, n) {
102
+ function J(e = [], t, n) {
103
103
  return y({
104
104
  mutationKey: [...e, t],
105
105
  mutationFn: async (o) => {
@@ -211,7 +211,7 @@ var q;
211
211
  e.generateClientServerInfiniteQuery = s;
212
212
  })(q || (q = {}));
213
213
  function ee(e) {
214
- return M(
214
+ return J(
215
215
  ["accounts", "update"],
216
216
  e,
217
217
  ({
@@ -731,17 +731,20 @@ function qe(e, t, n = 100, o = void 0, i = !0) {
731
731
  return p({
732
732
  queryKey: ["communities", "list", e, t, n],
733
733
  enabled: i,
734
- queryFn: async () => await a.hiveClient.call(
735
- "bridge",
736
- "list_communities",
737
- {
738
- last: "",
739
- limit: n,
740
- sort: e,
741
- query: t,
742
- observer: o
743
- }
744
- ) ?? []
734
+ queryFn: async () => {
735
+ const c = await a.hiveClient.call(
736
+ "bridge",
737
+ "list_communities",
738
+ {
739
+ last: "",
740
+ limit: n,
741
+ sort: e,
742
+ query: t,
743
+ observer: o
744
+ }
745
+ );
746
+ return c ? e === "hot" ? c.sort(() => Math.random() - 0.5) : c : [];
747
+ }
745
748
  });
746
749
  }
747
750
  var W = /* @__PURE__ */ ((e) => (e.OWNER = "owner", e.ADMIN = "admin", e.MOD = "mod", e.MEMBER = "member", e.GUEST = "guest", e.MUTED = "muted", e))(W || {});
@@ -803,7 +806,7 @@ export {
803
806
  ie as useAccountRelationsUpdate,
804
807
  ee as useAccountUpdate,
805
808
  fe as useAddFragment,
806
- M as useBroadcastMutation,
809
+ J as useBroadcastMutation,
807
810
  he as useEditFragment,
808
811
  be as useGameClaim,
809
812
  de as useRemoveFragment,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/sdk",
3
3
  "private": false,
4
- "version": "1.0.47",
4
+ "version": "1.0.48",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",