@vechain/vechain-kit 1.6.0 → 1.6.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.
package/dist/index.cjs CHANGED
@@ -5989,7 +5989,7 @@ var AddressDisplay = ({
5989
5989
  // package.json
5990
5990
  var package_default = {
5991
5991
  name: "@vechain/vechain-kit",
5992
- version: "1.6.0",
5992
+ version: "1.6.1",
5993
5993
  private: false,
5994
5994
  homepage: "https://github.com/vechain/vechain-kit",
5995
5995
  repository: "github:vechain/vechain-kit",
@@ -14573,7 +14573,7 @@ var CustomizationContent = ({
14573
14573
  reason: "back_button"
14574
14574
  });
14575
14575
  }
14576
- setCurrentContent("profile");
14576
+ setCurrentContent(initialContentSource);
14577
14577
  };
14578
14578
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
14579
14579
  /* @__PURE__ */ jsxRuntime.jsxs(StickyHeaderContainer, { children: [
@@ -14931,12 +14931,8 @@ var CustomizationSummaryContent = ({
14931
14931
  onDoneRedirectContent
14932
14932
  }) => {
14933
14933
  const { t } = reactI18next.useTranslation();
14934
- const { darkMode: isDark } = useVeChainKitConfig();
14934
+ const { darkMode: isDark, network } = useVeChainKitConfig();
14935
14935
  const { account, connectedWallet } = useWallet();
14936
- const { refresh: refreshMetadata } = useRefreshMetadata(
14937
- account?.domain ?? "",
14938
- account?.address ?? ""
14939
- );
14940
14936
  const { data: upgradeRequired } = useUpgradeRequired(
14941
14937
  account?.address ?? "",
14942
14938
  connectedWallet?.address ?? "",
@@ -14951,6 +14947,7 @@ var CustomizationSummaryContent = ({
14951
14947
  });
14952
14948
  const domain = account?.domain ?? "";
14953
14949
  const { data: resolverAddress } = useGetResolverAddress(domain);
14950
+ const queryClient = reactQuery.useQueryClient();
14954
14951
  const {
14955
14952
  sendTransaction: updateTextRecord,
14956
14953
  txReceipt,
@@ -14983,7 +14980,7 @@ var CustomizationSummaryContent = ({
14983
14980
  }
14984
14981
  });
14985
14982
  try {
14986
- await refreshMetadata();
14983
+ await refresh();
14987
14984
  } catch (error) {
14988
14985
  console.error("Error refreshing data:", error);
14989
14986
  }
@@ -15076,6 +15073,22 @@ var CustomizationSummaryContent = ({
15076
15073
  }
15077
15074
  });
15078
15075
  };
15076
+ const refresh = async () => {
15077
+ queryClient.setQueryData(
15078
+ getAvatarQueryKey(domain, network.type),
15079
+ chunkIHFWUAH2_cjs.convertUriToUrl("ipfs://" + changes.avatarIpfsHash, network.type)
15080
+ );
15081
+ queryClient.setQueryData(
15082
+ getAvatarOfAddressQueryKey(account?.address ?? ""),
15083
+ chunkIHFWUAH2_cjs.convertUriToUrl("ipfs://" + changes.avatarIpfsHash, network.type)
15084
+ );
15085
+ await queryClient.invalidateQueries({
15086
+ queryKey: getTextRecordsQueryKey(domain, network.type)
15087
+ });
15088
+ await queryClient.refetchQueries({
15089
+ queryKey: getTextRecordsQueryKey(domain, network.type)
15090
+ });
15091
+ };
15079
15092
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "form", onSubmit: handleSubmit(onSubmit), children: [
15080
15093
  /* @__PURE__ */ jsxRuntime.jsxs(StickyHeaderContainer, { children: [
15081
15094
  /* @__PURE__ */ jsxRuntime.jsx(react.ModalHeader, { children: t("Confirm Changes") }),
@@ -15155,7 +15168,8 @@ var ProfileContent = ({
15155
15168
  setCurrentContent({
15156
15169
  type: "account-customization",
15157
15170
  props: {
15158
- setCurrentContent
15171
+ setCurrentContent,
15172
+ initialContentSource: "profile"
15159
15173
  }
15160
15174
  });
15161
15175
  },