@bbki.ng/site 1.1.13 → 1.1.15

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.15
4
+
5
+ ## 1.1.14
6
+
3
7
  ## 1.1.13
4
8
 
5
9
  ## 1.1.12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
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
 
@@ -14,33 +14,25 @@ export const ReloadPrompt = () => {
14
14
  },
15
15
  onOfflineReady() {
16
16
  console.log("App is offline-ready");
17
- toast("", {
18
- description: "已支持离线访问",
19
- position: "bottom-center",
20
- });
21
17
  },
22
18
  });
23
19
 
24
- useEffect(() => {
25
- if (!needRefresh) {
26
- console.log("无需更新");
27
- return;
28
- }
20
+ if (!needRefresh) {
21
+ console.log("无需更新");
22
+ return;
23
+ }
29
24
 
30
- updateServiceWorker(false).then(() => {
31
- // @ts-ignore
32
- const appVer = GLOBAL_BBKING_VERSION;
25
+ updateServiceWorker(false).then(() => {
26
+ // @ts-ignore
27
+ const appVer = GLOBAL_BBKING_VERSION;
33
28
 
34
- toast("", {
35
- description: "已自动更新到 v" + appVer + "。",
36
- position: "bottom-center",
37
- });
38
-
39
- if (!needRefresh) {
40
- setNeedRefresh(false);
41
- }
29
+ toast("", {
30
+ description: "已自动更新到 v" + appVer + "。",
31
+ position: "bottom-center",
42
32
  });
43
- }, [needRefresh]);
33
+
34
+ setNeedRefresh(false);
35
+ });
44
36
 
45
37
  return null;
46
38
  };
@@ -42,5 +42,8 @@ export default () => {
42
42
  return null;
43
43
  }
44
44
 
45
+ // scroll to top
46
+ window.scrollTo(0, 0);
47
+
45
48
  return <ArticlePage title={title}>{posts.content}</ArticlePage>;
46
49
  };