@bitsocial/bitsocial-react-hooks 0.1.3 → 0.1.5
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.
- package/CHANGELOG.md +213 -0
- package/README.md +9 -0
- package/dist/stores/feeds/utils.d.ts.map +1 -1
- package/dist/stores/feeds/utils.js +29 -1
- package/dist/stores/feeds/utils.js.map +1 -1
- package/dist/stores/replies/replies-store.d.ts.map +1 -1
- package/dist/stores/replies/replies-store.js +9 -2
- package/dist/stores/replies/replies-store.js.map +1 -1
- package/dist/stores/replies/utils.d.ts +11 -2
- package/dist/stores/replies/utils.d.ts.map +1 -1
- package/dist/stores/replies/utils.js +51 -5
- package/dist/stores/replies/utils.js.map +1 -1
- package/package.json +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
## [0.1.5](https://github.com/bitsocialnet/bitsocial-react-hooks/compare/v0.1.4...v0.1.5) (2026-05-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **ci:** fetch tags for release notes ([6d22e9f](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/6d22e9f154621124757aef393dd8717657042c0a))
|
|
7
|
+
* **replies:** hide purged account replies ([570a5f2](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/570a5f24dbbb370c6d2ced6a2f6aff8fcfb053e2))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [0.1.4](https://github.com/bitsocialnet/bitsocial-react-hooks/compare/v0.1.3...v0.1.4) (2026-04-30)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **ci:** create GitHub release after publish ([26562d5](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/26562d5100e7108ba4c505df99d4aaed4594d4fb))
|
|
17
|
+
* **stores:** dedupe pending comments after approval ([1fe46f7](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/1fe46f7279a2d758dca30f0117fff62a2ab44a46))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [0.1.3](https://github.com/bitsocialnet/bitsocial-react-hooks/compare/v0.1.2...v0.1.3) (2026-04-29)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **accounts:** use explicit RPC fallbacks for ETH defaults ([b0c9907](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b0c9907ae50139434ba86adf151b3d90de093d2c))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.1.2](https://github.com/bitsocialnet/bitsocial-react-hooks/compare/d95bed5a75b832fbbfc980b34ead43d8e6848fba...v0.1.2) (2026-04-20)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **accounts-store:** add fetching link dimensions state ([15cf17f](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/15cf17f29a56334024e09c3a05b60e513df30d59))
|
|
36
|
+
* **accounts-store:** add fetching link dimensions state ([f226408](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f226408dc7ef44d442c0341fdba3834068e8030f))
|
|
37
|
+
* **accounts-store:** dont mutate subscriptions array ([a3088a3](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/a3088a3a1605aee31fbc6539e5bcb115116a80cf))
|
|
38
|
+
* **accounts-store:** instantly return account comment index from usePublishComment ([3e16386](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/3e1638684a157191e41eb3251232c4570835b4ec))
|
|
39
|
+
* **accounts-store:** only fetch 10 comment updates on init, it slows down fetching comments/subs ([e45f527](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/e45f52713d3ca1cb6831cb40525d4d30129a35d2))
|
|
40
|
+
* **accounts-store:** subscribe and block actions add to db async, so feedback is more instant ([d551fd5](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d551fd58ac5e048d240954993792fe3e7325a3b5))
|
|
41
|
+
* **accounts-store:** validate replies notifications properly ([9e7b06b](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/9e7b06b846b514b11c66c704a71ee8da9ddce296))
|
|
42
|
+
* **accounts:** address account history review regressions ([fbe9c3d](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/fbe9c3d37853ceb360cbe1c560ccc6690a1716f6))
|
|
43
|
+
* **accounts:** address final account history review findings ([7feb65d](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/7feb65d5f351c4a231f3cc9f34e7c6710b6f7cc2))
|
|
44
|
+
* **accounts:** align pending comment failure state with plebbit-js ([#48](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/48)) ([a9f7111](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/a9f71118667184095b064d54f2d427636acfb049))
|
|
45
|
+
* **accounts:** compact legacy stored account comments ([#44](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/44)) ([5f90193](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/5f90193153cb7d0d1be5105e6cb45e8a8bb35300))
|
|
46
|
+
* **accounts:** deeply compact stored account comments ([#46](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/46)) ([f2f8b4c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f2f8b4cc82fad6d07aa8f3c0d22f42fa5e1046fb))
|
|
47
|
+
* **accounts:** defer moderation rollback until edit is stored ([b59b8a0](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b59b8a07aa47a3501e052f548fa7f69105040c82))
|
|
48
|
+
* **accounts:** optimistically remove pending comment on abandon delete ([bde1501](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/bde1501c703ae474c6de3b46cd05511fd3d8900e))
|
|
49
|
+
* **accounts:** preserve legacy publication field names ([#29](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/29)) ([dc23dca](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/dc23dca88055c13a52f6ee6106a25cc64f105210))
|
|
50
|
+
* **accounts:** roll back failed optimistic comment edits ([#34](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/34)) ([45aa5f6](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/45aa5f6baa8bc7be7348bec45f941a93e3535743))
|
|
51
|
+
* **accounts:** rollback terminal comment edit challenge failures ([#35](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/35)) ([d8af0ad](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d8af0adffb8d4debe0a20b8805667093c77f3fad)), closes [#33](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/33)
|
|
52
|
+
* **accounts:** simplify account history query naming ([38a67e3](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/38a67e349a7346393b2cb4946676663c6804f023))
|
|
53
|
+
* **accounts:** stabilize account history e2e paths ([b9705b6](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b9705b65e959b0bedba21dbb8a0c340c183f069e))
|
|
54
|
+
* **accounts:** start comment moderation publish earlier ([10ef375](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/10ef375402a4009685906386f939cf019d9f9550))
|
|
55
|
+
* **accounts:** stop auto-generating sol wallets ([2eab3dc](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/2eab3dce70703e65f324db1834f8fd1ebf8b5b6c)), closes [#20](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/20)
|
|
56
|
+
* **accounts:** stop stale moderation edits from sticking ([f8af7b6](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f8af7b652dc924b4392105cc4166ab01486bd79f))
|
|
57
|
+
* **accounts:** switch default eth rpc to publicnode ([85d3ee4](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/85d3ee498d33080c223e5dde0ce011145a58e7f7))
|
|
58
|
+
* **actions:** add exports and test ([b298a50](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b298a505f49b4db103aaffd258195d2df9a07ab5))
|
|
59
|
+
* **actions:** ignore stale usePublishComment updates after abandon ([cb0ad7e](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/cb0ad7ecb2735c98ccd5764c0901aae6ebf16b16))
|
|
60
|
+
* **actions:** implement usePublishCommentModeration ([1a8a5c1](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/1a8a5c1074c581bf0f2aa9832195d79e5e48bf56))
|
|
61
|
+
* address community refactor follow-up bugs ([#24](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/24)) ([1c38324](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/1c383246951879a56a4870a205003d5ddf06cbc2)), closes [#22](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/22)
|
|
62
|
+
* **authors-comments-store:** scrolling comments stalls sometimes ([173b214](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/173b21424bf38ff389cec9cb47620784888ef194))
|
|
63
|
+
* **authors-comments:** tolerate React 19 batching off-by-one in discover lastCommentCid test ([20676f8](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/20676f8e80993d974eb11b86b1f4dac0a5854cfd))
|
|
64
|
+
* **authors:** align author name resolution with pkc-js ([#53](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/53)) ([3294f39](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/3294f391958b68804b444555f9883106081d8c94))
|
|
65
|
+
* **authors:** support .bso author address resolution ([35da119](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/35da11928797495073ae52bede4df62c72e6872b)), closes [#21](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/21)
|
|
66
|
+
* **authors:** undefined useAuthorAddress with argument accountComment before challenge verification ([6ec824e](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/6ec824eaadb7dacc024b7fc74d2a97174075647c))
|
|
67
|
+
* **build:** remove consumer patch requirements ([#50](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/50)) ([cd76e12](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/cd76e12f362fbe6bd27c8f688ef4bec2838efb92))
|
|
68
|
+
* **build:** support TypeScript 6 compiler checks ([29cd3e6](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/29cd3e6f58a0188dbed6db75840f0689df630cd1))
|
|
69
|
+
* **chain:** auto generated wallets had timestamps in ms, not seconds ([24f2373](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/24f2373f9f8cfadadac58e2afa027637b670b879))
|
|
70
|
+
* **ci:** align browser e2e pkc options ([b29ca70](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b29ca70187535e6f0f81c27d38337a8f07a51c3c))
|
|
71
|
+
* **ci:** avoid husky during yarn install ([a3c2184](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/a3c218401f36262e706a64a7dbaef010e605e653))
|
|
72
|
+
* **ci:** disable husky during yarn install to prevent git dependency postinstall failure ([9dd99f7](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/9dd99f7fb062ae709afcec6afc39f864b8e1e63b))
|
|
73
|
+
* **ci:** drop legacy yarn install flags ([5921bde](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/5921bded2f869ba9f6cd983a4ee7e346dd0f8dfc))
|
|
74
|
+
* **ci:** push dist auto-commit from branch instead of detached HEAD ([57a3921](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/57a39219cdf3db1cbc310836290ecf9b18becf72))
|
|
75
|
+
* **ci:** reduce e2e debug output ([ce7eeb1](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ce7eeb11bab3475b7ebbd71b0f55adb34312ae50))
|
|
76
|
+
* **ci:** remove setup-node yarn cache ([ec3a133](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ec3a1336f852f82cebb5cf2678a11fe8a5e18b21))
|
|
77
|
+
* **ci:** replace tsgo with tsc in type-check script ([5b2144d](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/5b2144d0ba9b8df380280b7bdc828ba5c6b5232e))
|
|
78
|
+
* **ci:** retry yarn install with cache clean on corrupt tar extraction ([434bec2](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/434bec2fd4ef4d4bd183900d555dea6800e2a0de))
|
|
79
|
+
* **ci:** skip non-e2e build scripts during checks install ([c7f18d9](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/c7f18d94380a572a985d919d5949dc372aee18ab))
|
|
80
|
+
* **ci:** use --network-concurrency 1 to avoid yarn v1 parallel tar extraction race ([2073797](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/2073797468bbeef8c813b060f7162a49e9f2b943))
|
|
81
|
+
* **comments:** address PR 31 review follow-ups ([#32](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/32)) ([0b0d635](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/0b0d6359520abebbd1116dfeafabd270b773342f))
|
|
82
|
+
* **comments:** new comments shouldnt show updating state for 5 minutes ([1691bdf](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/1691bdfb087da23e8c14592500788b3f099782b2))
|
|
83
|
+
* **comments:** plebbit.createComment throws adds useComment().error ([8ff7aba](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/8ff7aba2a1133d1de80775de7370a36a497abce7))
|
|
84
|
+
* **comments:** resolve pending mod-queue comments without updatedAt in useComment path ([7236fc4](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/7236fc422d09189862cd9ffeb0417d07b73c6893)), closes [#8](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/8)
|
|
85
|
+
* **communities:** unwrap stats cid content ([#51](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/51)) ([39d4d7a](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/39d4d7ab99b991ce21815b5718ee5c5c89eee111))
|
|
86
|
+
* correct property exclusion in useEditedComment comparison logic ([f1c6af5](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f1c6af5b1d8de111bb79d2c782d9142d9c5fd644))
|
|
87
|
+
* **deps:** patch minimatch security override ([3264934](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/3264934d5815b362ba583da11279a9af3f38e87d))
|
|
88
|
+
* **deps:** remediate dependabot alerts via ethers upgrade and transitive resolutions ([ecf5c6e](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ecf5c6e67b6c78f0bb68d1d8a5de135d1cce4244))
|
|
89
|
+
* **deps:** resolve Dependabot alerts for protobufjs and follow-redirects ([3b993b6](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/3b993b6a92a50b7ae17e109d4844bf0be9b611ae))
|
|
90
|
+
* **deps:** resolve dependabot transitive vulnerabilities ([8403967](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/84039678ddab805c4a9be7b4c627ba9f927967fd))
|
|
91
|
+
* **deps:** resolve lodash dependabot alerts ([6db0e8e](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/6db0e8e3e1186e92c0590cee9d9bf319af436f22))
|
|
92
|
+
* **e2e:** add auto-cleanup to custom renderHook to prevent root leaks ([fe274a6](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/fe274a675b8086bb97624152a862c60ed3c6c7aa))
|
|
93
|
+
* **e2e:** bypass RTL auto-cleanup by managing React root directly ([f7bf6e5](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f7bf6e54aa9386f874b238d9ef72e1c6ce6a59a5))
|
|
94
|
+
* **e2e:** migrate vitest-e2e config to Vitest 4 browser provider API ([23907ff](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/23907ff4bdb26743b426705a2f6db84506eb07dc))
|
|
95
|
+
* **e2e:** test comment validation directly via commentIsValid ([00743c4](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/00743c41a0cbbb88d29dccf21f45b69c16b8850c))
|
|
96
|
+
* **e2e:** unmount beforeEach root before creating new one in validate comments ([f1185c0](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f1185c00e8102c5c8e5d7a19e7cd7828a14b688e))
|
|
97
|
+
* **e2e:** use custom renderHook in browser tests to avoid React 19 unmounted root error ([b541452](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b5414520852cf65f4347d45238d75caddb574de2))
|
|
98
|
+
* **feed-stores:** hasMore is true when feed cache expires ([ec1dd54](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ec1dd542d5b045f9a27eca54614212b0c6e0f458))
|
|
99
|
+
* **feeds:** crash when switching accounts ([c7450a9](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/c7450a9c1fed135375777406c4b821f9627c738f))
|
|
100
|
+
* **feeds:** evict approved posts from mod queue feeds ([b1682b1](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b1682b1054bc818424658205f02e7a4ad6ef5600)), closes [#17](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/17)
|
|
101
|
+
* **feeds:** feeds fetch infinite pages when subplebbit.fetchedAt cache expires ([6606b68](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/6606b68420bf47d4fbd01470788d90a16b2c93c3))
|
|
102
|
+
* **feeds:** filter stale public posts out of pending approval feeds ([a1b77b2](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/a1b77b209692272fc50a3497d704c1135413c89e)), closes [#18](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/18)
|
|
103
|
+
* **feeds:** hot score needs Math.abs or negative score is ignored ([d41b6a2](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d41b6a277dd487beb7a6bc48a7c655eff0285290))
|
|
104
|
+
* **feeds:** refresh subplebbit snapshots on feed reset ([b98fb82](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b98fb823318491690734febaeabb9ddf1c2950dc)), closes [#19](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/19)
|
|
105
|
+
* filter API is now {filter: Function: key: string} ([bb91724](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/bb91724d01c49f87da5599c37799ad6a933ba780))
|
|
106
|
+
* fix subplebbit blocking issue ([e7c5031](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/e7c50315e70ac5e574e10c0fe20472c24f1ff195))
|
|
107
|
+
* harden hook error paths and cleanup leaks ([09fc6ea](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/09fc6ea47fcfc0ea3d8d01c6d2c85ac386002179))
|
|
108
|
+
* **hooks:** mirror moderation flags into commentModeration ([a16a1b5](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/a16a1b5c4af610a7bbf75716c942862c4424920f)), closes [#11](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/11)
|
|
109
|
+
* **lint:** resolve yarn lint issues ([ec7c43a](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ec7c43a286225f9969b9700f2fe15f46481d513b))
|
|
110
|
+
* **mock-content:** use real private key ([590e168](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/590e1682e901f9de60eefbb3b3dc14655c0c065d))
|
|
111
|
+
* **moderation:** add live e2e coverage and sourcemaps ([dac0604](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/dac0604195cb85fa035aea8f64457666d5b10f04))
|
|
112
|
+
* **pkc-js:** normalize short address params ([60e02c2](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/60e02c2fed9629208123cd47663fb919fe663a7f))
|
|
113
|
+
* **plebbit-rpc:** add initial rpc settings state ([64b6451](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/64b64514de4814727dfa418d4e71d3cf293531c0))
|
|
114
|
+
* **plebbit-rpc:** update usePlebbitRpcSettings to new api ([375677c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/375677c489f9d3f85b841e819b76c674f4d5b745))
|
|
115
|
+
* **replies store:** sync updated feeds with local reply deletions ([7f9318f](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/7f9318f235aec04590e2b936bde9e2a47695bdf1))
|
|
116
|
+
* **replies:** tolerate async page fetch timing in sort type best fallback test ([8438da0](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/8438da05be82c659ce3c05a086dc57b7cb5f7068))
|
|
117
|
+
* restore CI after address refactor follow-ups ([68e0289](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/68e0289739b0c17f40272fe9e7dd064697c01dc8))
|
|
118
|
+
* restore publication mock types for ci type-check ([231547e](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/231547ee864a0eada541aeb4a939522dc4f5d4b5))
|
|
119
|
+
* **states:** non chainproviders clients are showing as 'resolving-address' state ([edc5d85](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/edc5d85713f63281f0d1aaecabf89c8e35589046))
|
|
120
|
+
* **states:** show updating states when posts cache is expired ([9809e94](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/9809e948eff14428314c368404c43a98d51c7114))
|
|
121
|
+
* **subplebbits:** plebbit.createSubplebbit throws adds useSubplebbit().error ([6750688](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/675068878177771ee8233e68aa4d4a933fba82f9))
|
|
122
|
+
* **subplebbits:** update subplebbit stats on subplebbit change ([d24b67e](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d24b67eccb765e833c5430b674e0342e2500e859))
|
|
123
|
+
* **subplebbit:** treat .eth and .bso subplebbit addresses as equivalent ([d56c73b](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d56c73b10efaa0a12623cadd43c757cac204efd9)), closes [#12](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/12)
|
|
124
|
+
* **test:** prevent replies.test.ts cascade from prototype pollution and timing races ([ef9ce90](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ef9ce907fc3a67a33cab1e938afef888a446d095)), closes [#5](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/5)
|
|
125
|
+
* **tests:** correct assignment-as-comparison, unused waitFor2, and mock restore bugs ([3a7f2fe](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/3a7f2fedd38d56aae57a7cc5b8b5cc79fdff13eb))
|
|
126
|
+
* **tests:** relax transient plebbit rpc state assertion ([f1ee69d](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f1ee69ddbbef1e03b272512e18d3ef34c37f52c2))
|
|
127
|
+
* **test:** stabilize filtered multi-community feed assertion ([07bc14c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/07bc14c0e47194c0d088f5cc3300def3a3dc9db7))
|
|
128
|
+
* **test:** stabilize initial hot feed assertion ([01344a4](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/01344a492bbfe422c7b2bdd51e52edfd7e29e37c))
|
|
129
|
+
* **tests:** wait for appended reply before asserting order ([aeb7e6b](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/aeb7e6b4858f188277e89b5dfe1f7afc412c2a09))
|
|
130
|
+
* **test:** use high custom ports for test IPFS nodes to avoid conflicts ([d0d8862](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d0d8862b46b78c6211e50497953117cb05dfece8))
|
|
131
|
+
* **test:** wait for parent comment indexing before publishing reply ([3a300f9](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/3a300f9de17266c36293ebfb862251b4ff93437f))
|
|
132
|
+
* **test:** wait for updatedAt instead of timestamp for parent indexing ([aecf86f](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/aecf86f6ad6eb6bbfbd91cecfe690cea2906ac31))
|
|
133
|
+
* **types:** declare window defaults for account generator ([a08cb1a](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/a08cb1ad7313d27cffb7b8f0f2a6b395d23e76e4))
|
|
134
|
+
* **utils:** incorrect import ([b74cc63](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b74cc63f9622fb4d0d52cb2e30c321d6aff955c2))
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
### Features
|
|
138
|
+
|
|
139
|
+
* **accounts-store:** add default sol chain provider ([c660709](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/c660709eaa602c4f70e9ac5a20ac1c6ee6b29a1e))
|
|
140
|
+
* **accounts-store:** generate eth and sol wallets based on the plebbit private key ([def94d0](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/def94d0addb936a869b0e24324105dbd496ea281))
|
|
141
|
+
* **accounts-store:** implement comment.linkHtmlTagName ([2edeb5c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/2edeb5c20b274f717e28c2e4c4c0fd4e99a2a697))
|
|
142
|
+
* **accounts-store:** migrate account db ([450858c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/450858c243d8c1191d444bd1571ef07dedb2f2fc))
|
|
143
|
+
* **accounts-store:** validate replies pages for notifications ([b97761f](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b97761fcb33825063d3c3c8c72eb453e06b09514))
|
|
144
|
+
* **accounts:** add abandonPublish and hard-delete account comments ([fe5e5b7](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/fe5e5b786a7d1b87d06e6895753fb075028cf988)), closes [plebbit/plebbit-react-hooks#2](https://github.com/plebbit/plebbit-react-hooks/issues/2) [#7](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/7)
|
|
145
|
+
* **accounts:** dedupe equivalent .eth and .bso account subplebbits under canonical .bso key ([09967e8](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/09967e87cdf12c52e3be642d34bccc1123624a4d)), closes [#16](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/16)
|
|
146
|
+
* **account:** wire bso-resolver into pkc ([3138d4c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/3138d4c1f35d72dc9de0ce4def38dd463d0c6a9f))
|
|
147
|
+
* add onlyIfCached to hooks to improve performance ([b01838c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b01838c5bd1fe904cb938a18ac8a5eb119a91b6b))
|
|
148
|
+
* **authors:** add .sol to useResolvedAuthorAddress ([0a3df5c](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/0a3df5c93f4b046c940b02219c13b75ae108fabe))
|
|
149
|
+
* **authors:** add setAuthorAvatarsWhitelistedTokenAddresses ([21dd181](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/21dd181a8afa71babcf2a4559d0dd45484b502bd))
|
|
150
|
+
* **chain:** validate wallet timestamp must be less than Date.now() / 1000 ([9e70b9a](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/9e70b9a91addd93c4f6a8a3796efa36adfd2635f))
|
|
151
|
+
* **comments:** add auto update controls and refresh ([#31](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/31)) ([15cf2df](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/15cf2df879f5ab4a9bc224c203504a864c962f9b))
|
|
152
|
+
* **comments:** implement useValidateComment ([b337c52](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b337c520222c71409352aa07ef44b6924fec73ba))
|
|
153
|
+
* **comments:** useComment can use comment from replies pages ([f259741](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f2597418aec9ac2be14cee3b9790ef7fa2f884e2))
|
|
154
|
+
* **feeds-store:** add validatePages: false ([9b11dd8](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/9b11dd888f319ad038a24c9b1da373858ce00417))
|
|
155
|
+
* **feeds-store:** if no next cid and no page cids, use preloaded page of any sort type ([5a24836](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/5a24836e0ce8e4a5a514184e6c4f45e85b394d3a))
|
|
156
|
+
* **feeds:** add old and best sort ([e5b30dc](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/e5b30dcd62f1f355bc3ce52555e7f71ea4cae06b))
|
|
157
|
+
* **feeds:** implement auto set correct time for topAll and controversialAll when newerThan is set ([4f33f77](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/4f33f772d94060072c65fbbd2b7ebacae8f59c06))
|
|
158
|
+
* **feeds:** implement useFeed modQueue pendingApproval ([5135645](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/51356455aae0420a855f3fd1f53c2bc589e4a3c3))
|
|
159
|
+
* **feeds:** implement useFeed().bufferedFeed ([7efd7f8](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/7efd7f888d0053b8e5ec385ded0d546046f90c0f))
|
|
160
|
+
* **feeds:** implement useFeed().reset() ([773df5a](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/773df5ad8d8477849e0effceaa57f7b1a28e1082))
|
|
161
|
+
* **feeds:** implement useFeed().updatedFeeds ([f9c08b0](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f9c08b0dcf5a234f1755ea6cfd9a612f9502a733))
|
|
162
|
+
* **feeds:** implement useFeed({accountComments}) ([7064e8f](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/7064e8f84d54ab7be573023c753b70e737ff9e3b))
|
|
163
|
+
* **feeds:** implement useFeed({newerThan: seconds}) ([571861a](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/571861a1aaadc2eca9b3edc93444fbc33acbe084))
|
|
164
|
+
* **feeds:** implement useFeeds().subplebbitAddressesWithNewerPosts ([b32bdf6](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b32bdf6a820bf68aac84423ffc4adec9d9ebaad3))
|
|
165
|
+
* **feeds:** support in-place time-window expansion ([e3526ef](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/e3526efd55678d1278cc882b2edbbaa0352be9f2))
|
|
166
|
+
* **hooks:** require explicit community objects ([#49](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/49)) ([c46ddc0](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/c46ddc05834d934c5c4fc849ba42d414d8174460))
|
|
167
|
+
* **mock:** add `purged` moderation field to mock and tests ([f813f94](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f813f9480a203ea06d9bc44af98027dba789ba3f)), closes [#1](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/1)
|
|
168
|
+
* **plebbit-rpc:** implement usePlebbitRpcSettings ([ae28916](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ae28916952b17625db64b40583fd9f7d7189f590))
|
|
169
|
+
* **protocol:** migrate hooks library to pkc-js ([153df23](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/153df23a533131f9e8942fadd12a6337694ff646))
|
|
170
|
+
* **replies-pages-store:** implement replies pages store ([d3d98f4](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d3d98f4e5612983e38ccb465af59e4d87123d8a4))
|
|
171
|
+
* **replies-store:** if no nextCid, all replies are preloaded and use any sort type ([15782c2](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/15782c25a81cde42e7afd51452151926ce8e1b61))
|
|
172
|
+
* **replies-store:** implement replies-store ([b244273](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b2442732d854a9df972fb67b93e82fdb10730d42))
|
|
173
|
+
* **replies:** add account comments to usereplies ([dc7f658](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/dc7f658d1518973eceeb0998d313a45be8ae1ce0))
|
|
174
|
+
* **replies:** add replies pages clients fetching state ([f071225](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f071225bab8540bf6e993e5383999e87ff2e479b))
|
|
175
|
+
* **replies:** implement flat ([b5a387b](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b5a387b6beb1dcfff8212f393790fa89df1a74d7))
|
|
176
|
+
* **replies:** implement useReplies().bufferedReplies ([e0d4213](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/e0d4213014ded7995e6b989628d91b4ec0851802))
|
|
177
|
+
* **replies:** implement useReplies().updatedReplies ([63dd2e8](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/63dd2e8dd0869ae464fc927ba36e95da399d415b))
|
|
178
|
+
* **replies:** implement useReplies({validateOptimistically}) ([5b6e22b](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/5b6e22b3ef0e3187bec8d9ee09d6f827d10145e8))
|
|
179
|
+
* **states:** useClientsStates gets comment and subplebbit updating states ([c341a25](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/c341a25f3f99186f1c4383f06c2f616ad0fc0999))
|
|
180
|
+
* **states:** useClientsStates when publishing ([ac21c96](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ac21c96bb9b8fd302713d469190e8c3860aa62cb))
|
|
181
|
+
* **states:** useSubplebbitsStates ([84c7a42](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/84c7a426d7a3f802b1c2cbda89f8b89e34407e35))
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
### Performance Improvements
|
|
185
|
+
|
|
186
|
+
* **accounts-store:** use entries instead of keys ([42d6b15](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/42d6b15360601df4b16fa89e485890510a9b1dc8))
|
|
187
|
+
* **accounts:** slim account history storage and query hot paths ([4a85fbc](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/4a85fbce10afb957a9d292c57e70f8ea2f741645))
|
|
188
|
+
* **ci:** parallelize e2e suites and inline dist publish in main workflow ([6d40eec](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/6d40eecf2e514bdd6d98f5b67f1c2992f3f2a8d0)), closes [#6](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/6)
|
|
189
|
+
* **feeds-store:** dont use subplebbit relative sorting anymore as it gives bad feed results ([b8201c9](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/b8201c924e57285c33080f1b8f36e3032d8987f1))
|
|
190
|
+
* **feeds:** expire subplebbits cache 1h after fetch (for feeds only) ([f7c87b0](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/f7c87b00bb7be6cdab77d63e40e7f73aacce1a8b))
|
|
191
|
+
* **feeds:** optimize buffered feeds that dont change ([1acd1fd](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/1acd1fd8182b20d9f34306fc79088a3a3bc3e64d))
|
|
192
|
+
* improve perf ([7cb055e](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/7cb055e6c6b055708f85648ce9584ec0f9556614))
|
|
193
|
+
* **replies:** add cached-only mode to useReplies ([#37](https://github.com/bitsocialnet/bitsocial-react-hooks/issues/37)) ([125df99](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/125df993e522ac438f18b290911dc501cc79b125))
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
### Reverts
|
|
197
|
+
|
|
198
|
+
* Revert "update to rpcOptions instead of port" ([0ca7d53](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/0ca7d5306fe82cefee8c32fc9480cd429d961021))
|
|
199
|
+
* Revert "change plebbit data path to /tmp for electron. May eliminate SQLite IO errors" ([bcf1a94](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/bcf1a94e01376996f25a5be5a901c9e8071df97e))
|
|
200
|
+
* Revert "use latest signer schema" ([26690be](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/26690bebda858bdb8111eab786dd1cd06563099c))
|
|
201
|
+
* Revert "update plebbit-js" ([a4c63e3](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/a4c63e37cf0e5f5fdeedd1f34de6d0fe26a9dfd0))
|
|
202
|
+
* Revert "fix undefined plebbit.dataPath before setAccount" ([d95bed5](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/d95bed5a75b832fbbfc980b34ead43d8e6848fba))
|
|
203
|
+
* dont use real signer for mock content, didnt work ([629c2f2](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/629c2f2a6f76129eb51e7e66b82517d1aaee2458))
|
|
204
|
+
* not necessary to mock ens ([ba1dc84](https://github.com/bitsocialnet/bitsocial-react-hooks/commit/ba1dc849341232de72e80f2b6406aa6dfc73538c))
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
### BREAKING CHANGES
|
|
208
|
+
|
|
209
|
+
* useFeed({filter}) and useAuthorComments({filter}) are now {filter: Function, key:
|
|
210
|
+
string}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
package/README.md
CHANGED
|
@@ -1016,6 +1016,12 @@ const { replies } = useReplies({
|
|
|
1016
1016
|
comment: post,
|
|
1017
1017
|
accountComments: { newerThan: Infinity, append: false },
|
|
1018
1018
|
});
|
|
1019
|
+
|
|
1020
|
+
// pending local account comments are reconciled with their approved network version
|
|
1021
|
+
// so the same post or reply is not shown twice after moderation approval
|
|
1022
|
+
// published account replies are only kept in useReplies while the canonical
|
|
1023
|
+
// replies feed may still contain them; after the feed is exhausted, account-only
|
|
1024
|
+
// published replies are hidden unless the canonical feed includes their cid
|
|
1019
1025
|
```
|
|
1020
1026
|
|
|
1021
1027
|
#### Determine if a comment is your own
|
|
@@ -1296,6 +1302,9 @@ const useRepliesOptions = {
|
|
|
1296
1302
|
accountComments: { newerThan: Infinity, append: false },
|
|
1297
1303
|
};
|
|
1298
1304
|
|
|
1305
|
+
// accountComments keeps pending local replies visible, but published account
|
|
1306
|
+
// replies must resolve through the canonical replies feed after it is exhausted
|
|
1307
|
+
|
|
1299
1308
|
const Reply = ({ reply, updatedReply }) => {
|
|
1300
1309
|
const { replies, updatedReplies, bufferedReplies, hasMore, loadMore } = useReplies({
|
|
1301
1310
|
...useRepliesOptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/stores/feeds/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAEP,KAAK,EAEL,YAAY,EACZ,SAAS,EACT,WAAW,EAEX,QAAQ,EAER,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAoHrB;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,cAAc,YAAY,EAC1B,aAAa,WAAW,EACxB,kBAAkB,gBAAgB,EAClC,UAAU,QAAQ,EAClB,mBAAmB;IAAE,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,UAmIrD,CAAC;AA0BF,eAAO,MAAM,cAAc,GACzB,cAAc,YAAY,EAC1B,qBAAqB,KAAK,EAC1B,aAAa,KAAK,EAClB,eAAe,KAAK,EACpB,UAAU,QAAQ,mBAyDnB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/stores/feeds/utils.ts"],"names":[],"mappings":"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"}
|
|
@@ -260,6 +260,19 @@ export const getLoadedFeeds = (feedsOptions, filteredSortedFeeds, loadedFeeds, b
|
|
|
260
260
|
}
|
|
261
261
|
return nextLoadedFeeds;
|
|
262
262
|
});
|
|
263
|
+
const getApprovalPublicationKey = (comment) => {
|
|
264
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
265
|
+
return [
|
|
266
|
+
(_a = comment.timestamp) !== null && _a !== void 0 ? _a : "",
|
|
267
|
+
(_b = comment.parentCid) !== null && _b !== void 0 ? _b : "",
|
|
268
|
+
(_c = comment.postCid) !== null && _c !== void 0 ? _c : "",
|
|
269
|
+
(_d = getCommentCommunityAddress(comment)) !== null && _d !== void 0 ? _d : "",
|
|
270
|
+
(_f = (_e = comment.author) === null || _e === void 0 ? void 0 : _e.address) !== null && _f !== void 0 ? _f : "",
|
|
271
|
+
(_g = comment.title) !== null && _g !== void 0 ? _g : "",
|
|
272
|
+
(_h = comment.content) !== null && _h !== void 0 ? _h : "",
|
|
273
|
+
(_j = comment.link) !== null && _j !== void 0 ? _j : "",
|
|
274
|
+
].join("\0");
|
|
275
|
+
};
|
|
263
276
|
export const addAccountsComments = (feedsOptions, loadedFeeds) => {
|
|
264
277
|
let loadedFeedsChanged = false;
|
|
265
278
|
const accountsComments = accountsStore.getState().accountsComments || {};
|
|
@@ -290,6 +303,9 @@ export const addAccountsComments = (feedsOptions, loadedFeeds) => {
|
|
|
290
303
|
accountCidToPost.set(p.cid, p);
|
|
291
304
|
}
|
|
292
305
|
let loadedFeed = loadedFeeds[feedName] || [];
|
|
306
|
+
const approvedPublicationKeys = new Set(loadedFeed
|
|
307
|
+
.filter((post) => post.pendingApproval !== true)
|
|
308
|
+
.map((post) => getApprovalPublicationKey(post)));
|
|
293
309
|
// prune stale local-account entries and replace when cid matches but index changed
|
|
294
310
|
const prunedLoadedFeed = [];
|
|
295
311
|
for (const post of loadedFeed) {
|
|
@@ -297,6 +313,11 @@ export const addAccountsComments = (feedsOptions, loadedFeeds) => {
|
|
|
297
313
|
prunedLoadedFeed.push(post);
|
|
298
314
|
continue;
|
|
299
315
|
}
|
|
316
|
+
if (post.pendingApproval === true &&
|
|
317
|
+
approvedPublicationKeys.has(getApprovalPublicationKey(post))) {
|
|
318
|
+
loadedFeedsChanged = true;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
300
321
|
if (!validAccountIndices.has(post.index)) {
|
|
301
322
|
loadedFeedsChanged = true;
|
|
302
323
|
continue;
|
|
@@ -321,16 +342,23 @@ export const addAccountsComments = (feedsOptions, loadedFeeds) => {
|
|
|
321
342
|
loadedFeed.forEach((post, loadedFeedIndex) => {
|
|
322
343
|
if (post.cid)
|
|
323
344
|
loadedFeedMap.set(post.cid, loadedFeedIndex);
|
|
324
|
-
if (post.index)
|
|
345
|
+
if (typeof post.index === "number")
|
|
325
346
|
loadedFeedMap.set(post.index, loadedFeedIndex);
|
|
326
347
|
if (!post.cid)
|
|
327
348
|
loadedFeedMap.set(post.timestamp, loadedFeedIndex);
|
|
349
|
+
if (post.pendingApproval !== true) {
|
|
350
|
+
loadedFeedMap.set(getApprovalPublicationKey(post), loadedFeedIndex);
|
|
351
|
+
}
|
|
328
352
|
});
|
|
329
353
|
for (const accountPost of accountPosts) {
|
|
330
354
|
// account post with cid already added
|
|
331
355
|
if (accountPost.cid && loadedFeedMap.has(accountPost.cid)) {
|
|
332
356
|
continue;
|
|
333
357
|
}
|
|
358
|
+
if (accountPost.pendingApproval === true &&
|
|
359
|
+
loadedFeedMap.has(getApprovalPublicationKey(accountPost))) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
334
362
|
// account post without cid already added, but now we have the cid
|
|
335
363
|
if (accountPost.cid && loadedFeedMap.has(accountPost.index)) {
|
|
336
364
|
const loadedFeedIndex = loadedFeedMap.get(accountPost.index);
|