dsh-pocket 1.3.1 → 1.3.2

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/client/client.js CHANGED
@@ -1348,7 +1348,7 @@ function PocketSettingsTab({ rpcCall }) {
1348
1348
  (async () => {
1349
1349
  try {
1350
1350
  const v = await call(POCKET_ENDPOINTS.version, {});
1351
- const meta = await (await fetch("https://registry.npmjs.org/dsh-pocket/latest")).json();
1351
+ const meta = await (await fetch("https://registry.npmjs.org/dsh-pocket/latest", { cache: "no-store" })).json();
1352
1352
  if (!alive) return;
1353
1353
  const latest = typeof meta?.version === "string" ? meta.version : null;
1354
1354
  if (latest && v.current && compareVersions(latest, v.current) > 0) {
package/client/index.jsx CHANGED
@@ -84,12 +84,13 @@ function PocketSettingsTab({ rpcCall }) {
84
84
 
85
85
  // 版本检测:host 当前版本 vs npm registry latest(registry 带 CORS *)
86
86
  // 两种情况显示横幅:① 有新版可更新;② 磁盘已更新但进程还是旧代码(重启生效)
87
+ // cache: 'no-store' —— registry 响应带缓存头,浏览器会缓存旧版本号导致「小版本不提示」
87
88
  useEffect(() => {
88
89
  let alive = true;
89
90
  (async () => {
90
91
  try {
91
92
  const v = await call(POCKET_ENDPOINTS.version, {});
92
- const meta = await (await fetch('https://registry.npmjs.org/dsh-pocket/latest')).json();
93
+ const meta = await (await fetch('https://registry.npmjs.org/dsh-pocket/latest', { cache: 'no-store' })).json();
93
94
  if (!alive) return;
94
95
  const latest = typeof meta?.version === 'string' ? meta.version : null;
95
96
  if (latest && v.current && compareVersions(latest, v.current) > 0) {
package/package.json CHANGED
@@ -76,5 +76,5 @@
76
76
  "access": "public",
77
77
  "registry": "https://registry.npmjs.org/"
78
78
  },
79
- "version": "1.3.1"
79
+ "version": "1.3.2"
80
80
  }