@ecency/sdk 2.0.0 → 2.0.1

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.
@@ -3564,6 +3564,10 @@ interface CommentPayload {
3564
3564
  body: string;
3565
3565
  /** JSON metadata object */
3566
3566
  jsonMetadata: Record<string, any>;
3567
+ /** Optional: Root post author (for nested replies, used for discussions cache invalidation) */
3568
+ rootAuthor?: string;
3569
+ /** Optional: Root post permlink (for nested replies, used for discussions cache invalidation) */
3570
+ rootPermlink?: string;
3567
3571
  /** Optional: Comment options (beneficiaries, rewards) */
3568
3572
  options?: {
3569
3573
  /** Maximum accepted payout (e.g., "1000000.000 HBD") */
@@ -5719,6 +5719,14 @@ function useComment(username, auth) {
5719
5719
  "entry",
5720
5720
  `/@${variables.parentAuthor}/${variables.parentPermlink}`
5721
5721
  ]);
5722
+ const discussionsAuthor = variables.rootAuthor || variables.parentAuthor;
5723
+ const discussionsPermlink = variables.rootPermlink || variables.parentPermlink;
5724
+ queriesToInvalidate.push({
5725
+ predicate: (query) => {
5726
+ const key = query.queryKey;
5727
+ return Array.isArray(key) && key[0] === "posts" && key[1] === "discussions" && key[2] === discussionsAuthor && key[3] === discussionsPermlink;
5728
+ }
5729
+ });
5722
5730
  }
5723
5731
  await auth.adapter.invalidateQueries(queriesToInvalidate);
5724
5732
  }