@bbki.ng/site 5.4.5 → 5.4.6

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 5.4.6
4
+
3
5
  ## 5.4.5
4
6
 
5
7
  ## 5.4.4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "5.4.5",
3
+ "version": "5.4.6",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  import useSWR from "swr";
2
2
  import { baseFetcher, withBBApi } from "@/utils";
3
3
  import { API_CF_ENDPOINT } from "@/constants/routes";
4
- import { useContext, useEffect } from "react";
4
+ import { useContext, useEffect, useState } from "react";
5
5
  import { GlobalLoadingContext } from "@/context/global_loading_state_provider";
6
6
 
7
7
  // In dev, use /api prefix to leverage Vite proxy to localhost:8787
@@ -26,6 +26,15 @@ export const useStreaming = () => {
26
26
 
27
27
  const isLoading = !data && !error;
28
28
 
29
+ const [_, forceUpdate] = useState(0);
30
+
31
+ // make rerender when customElement defined
32
+ useEffect(() => {
33
+ customElements.whenDefined("bb-msg-history").then(() => {
34
+ forceUpdate((prev) => prev + 1);
35
+ });
36
+ }, [])
37
+
29
38
  const { setIsLoading } = useContext(GlobalLoadingContext);
30
39
 
31
40
  useEffect(() => {