@bbki.ng/site 1.1.9 → 1.1.11

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.11
4
+
5
+ ## 1.1.10
6
+
3
7
  ## 1.1.9
4
8
 
5
9
  ## 1.1.8
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.7lbb0v70eog",
101
+ revision: "0.c0hd9u5kjpg",
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.9",
3
+ "version": "1.1.11",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "url": "git+https://github.com/bbbottle/bbki.ng.git"
17
17
  },
18
18
  "dependencies": {
19
- "@bbki.ng/components": "workspace:2.1.37",
19
+ "@bbki.ng/components": "workspace:2.1.38",
20
20
  "@supabase/supabase-js": "^1.30.6",
21
21
  "classnames": "2.3.1",
22
22
  "react": "^18.0.0",
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from "react";
2
- import { Link } from "@bbki.ng/components";
2
+ import { Link, Tag } from "@bbki.ng/components";
3
3
  import { useLocation } from "react-router-dom";
4
4
  import { usePaths } from "@/hooks";
5
5
  import { GlobalLoadingContext } from "@/global_loading_state_provider";
@@ -10,7 +10,17 @@ export const Footer = () => {
10
10
  const { isLoading } = useContext(GlobalLoadingContext);
11
11
 
12
12
  if (isRoot || isLoading) {
13
- return null;
13
+ // @ts-ignore
14
+ const appVer = GLOBAL_BBKING_VERSION;
15
+
16
+ const tagUrl = `https://github.com/bbbottle/bottle/releases/tag/@bbki.ng/site@${appVer}`;
17
+ return (
18
+ <div className="w-full flex justify-center">
19
+ <Tag to={tagUrl} prefix="v" external>
20
+ {appVer}
21
+ </Tag>
22
+ </div>
23
+ );
14
24
  }
15
25
 
16
26
  const paths = usePaths();
@@ -15,43 +15,30 @@ export const ReloadPrompt = () => {
15
15
  onOfflineReady() {
16
16
  console.log("App is offline-ready");
17
17
  toast("", {
18
- description: "已支持离线访问。",
18
+ description: "已支持离线访问",
19
19
  position: "bottom-center",
20
- actionButtonStyle: {
21
- backgroundColor: "#fff",
22
- color: "rgb(37,99,235)",
23
- },
24
20
  });
25
21
  },
26
22
  });
27
23
 
28
- // @ts-ignore
29
- const appVer = GLOBAL_BBKING_VERSION;
30
-
31
24
  useEffect(() => {
32
25
  if (!needRefresh) {
33
- console.log("版本 v" + appVer + ",无需更新。");
26
+ console.log("无需更新");
34
27
  return;
35
28
  }
36
29
 
37
- toast("", {
38
- description: "检测到更新,当前版本 v" + appVer + "。是否更新?",
39
- dismissible: false,
40
- position: "bottom-center",
41
- actionButtonStyle: {
42
- backgroundColor: "#fff",
43
- color: "rgb(37,99,235)",
44
- },
45
- action: {
46
- label: "是",
47
- onClick: () => {
48
- if (!needRefresh) {
49
- setNeedRefresh(false);
50
- return;
51
- }
52
- updateServiceWorker(true);
53
- },
54
- },
30
+ updateServiceWorker(true).then(() => {
31
+ // @ts-ignore
32
+ const appVer = GLOBAL_BBKING_VERSION;
33
+
34
+ toast("", {
35
+ description: "已自动更新到 v" + appVer + "。",
36
+ position: "bottom-center",
37
+ });
38
+
39
+ if (!needRefresh) {
40
+ setNeedRefresh(false);
41
+ }
55
42
  });
56
43
  }, [needRefresh]);
57
44
 
@@ -3,7 +3,7 @@ import { useProjects } from "@/hooks/use_projects";
3
3
  import { CenterLinkList, MySuspense } from "@/components";
4
4
 
5
5
  const Projects = () => {
6
- const { projects } = useProjects("", true);
6
+ const { projects } = useProjects();
7
7
 
8
8
  const links = projects.map((p: any) => ({
9
9
  to: `/projects/${p.name}`,
@@ -12,7 +12,7 @@ type TxtProps = {
12
12
 
13
13
  const Posts = (props: TxtProps) => {
14
14
  const name = useRouteName();
15
- const { titleList, isLoading, isError } = usePosts("", true);
15
+ const { titleList, isLoading, isError } = usePosts();
16
16
 
17
17
  if (isLoading) {
18
18
  return null;