@bbki.ng/site 1.1.12 → 1.1.14

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,9 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 1.1.14
4
+
5
+ ## 1.1.13
6
+
3
7
  ## 1.1.12
4
8
 
5
9
  ## 1.1.11
package/dev-dist/sw.js CHANGED
@@ -98,7 +98,7 @@ define(["./workbox-baccbcc1"], function (workbox) {
98
98
  [
99
99
  {
100
100
  url: "index.html",
101
- revision: "0.c0hd9u5kjpg",
101
+ revision: "0.k4fnnpiob1g",
102
102
  },
103
103
  ],
104
104
  {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,10 +9,9 @@ export const Footer = () => {
9
9
  const isRoot = location.pathname === "/";
10
10
  const { isLoading } = useContext(GlobalLoadingContext);
11
11
 
12
- if (isRoot || isLoading) {
12
+ if (isRoot) {
13
13
  // @ts-ignore
14
14
  const appVer = GLOBAL_BBKING_VERSION;
15
-
16
15
  const tagUrl = `https://github.com/bbbottle/bottle/releases/tag/@bbki.ng/site@${appVer}`;
17
16
  return (
18
17
  <div className="w-full flex justify-center">
@@ -23,6 +22,10 @@ export const Footer = () => {
23
22
  );
24
23
  }
25
24
 
25
+ if (isLoading) {
26
+ return null;
27
+ }
28
+
26
29
  const paths = usePaths();
27
30
  const prevPath = paths[paths.length - 2];
28
31
 
@@ -27,7 +27,7 @@ export const ReloadPrompt = () => {
27
27
  return;
28
28
  }
29
29
 
30
- updateServiceWorker(true).then(() => {
30
+ updateServiceWorker(false).then(() => {
31
31
  // @ts-ignore
32
32
  const appVer = GLOBAL_BBKING_VERSION;
33
33
 
@@ -1,7 +1,8 @@
1
1
  import useSWR, { useSWRConfig } from "swr";
2
2
  import { API } from "@/constants/routes";
3
- import { useCallback } from "react";
3
+ import { useCallback, useContext, useEffect } from "react";
4
4
  import { Photo } from "@/types/photo";
5
+ import { GlobalLoadingContext } from "@/global_loading_state_provider";
5
6
 
6
7
  export const useProjects = (name: string = "", suspense?: boolean) => {
7
8
  const URL = `${API.PROJECTS}${name ? "/" : ""}${name}`;
@@ -11,6 +12,14 @@ export const useProjects = (name: string = "", suspense?: boolean) => {
11
12
  suspense,
12
13
  });
13
14
 
15
+ let isLoading = !data && !error;
16
+
17
+ const { setIsLoading } = useContext(GlobalLoadingContext);
18
+
19
+ useEffect(() => {
20
+ setIsLoading(isLoading);
21
+ }, [isLoading]);
22
+
14
23
  const { mutate, cache } = useSWRConfig();
15
24
 
16
25
  const getCachedProjects = (n: string) => {
@@ -3,7 +3,11 @@ import { useProjects } from "@/hooks/use_projects";
3
3
  import { CenterLinkList } from "@/components";
4
4
 
5
5
  const Projects = () => {
6
- const { projects } = useProjects("");
6
+ const { projects, isLoading } = useProjects("");
7
+
8
+ if (isLoading) {
9
+ return null;
10
+ }
7
11
 
8
12
  const links = projects.map((p: any) => ({
9
13
  to: `/projects/${p.name}`,