@pandablessing/dsh-user-sync 1.0.17 → 1.0.18

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.
Files changed (2) hide show
  1. package/lib/client.js +5 -1
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -221,6 +221,8 @@ if (typeof window !== 'undefined' && window.__ModuleLoader__) {
221
221
  const [overwriteDialog, setOverwriteDialog] = R.useState(null);
222
222
  // 版本检查结果:有新版本时在面板顶部提示(不自动安装)
223
223
  const [updateInfo, setUpdateInfo] = R.useState(null);
224
+ // 更新完成弹窗(重启提示放在弹窗里,底部状态行看不到)
225
+ const [updateDone, setUpdateDone] = R.useState(null);
224
226
  // 一键更新:调宿主 /update(走 DSH 官方安装器),成功后提示重启
225
227
  const updatePlugin = async () => {
226
228
  const target = updateInfo?.latest;
@@ -235,7 +237,7 @@ if (typeof window !== 'undefined' && window.__ModuleLoader__) {
235
237
  });
236
238
  if (result.ok) {
237
239
  setUpdateInfo(null);
238
- setNotice({ kind: 'result', data: { detail: `已更新到 v${result.version ?? target},请重启 DSH 生效` } });
240
+ setUpdateDone(`已更新到 v${result.version ?? target},请重启 DSH 生效`);
239
241
  }
240
242
  else {
241
243
  setNotice({ kind: 'error', data: { detail: `更新失败:${result.error ?? '未知错误'}` } });
@@ -587,6 +589,8 @@ if (typeof window !== 'undefined' && window.__ModuleLoader__) {
587
589
  void applyRemote(target.name);
588
590
  },
589
591
  }, overwriteDialog.kind === 'upload' ? '用本机覆盖远端' : '用远端覆盖本机'), R.createElement('button', { style: styles.secondary, onClick: () => setOverwriteDialog(null) }, '取消'))))
592
+ : null, updateDone
593
+ ? R.createElement('div', { style: styles.overlay, onClick: () => setUpdateDone(null) }, R.createElement('div', { style: styles.dialog, onClick: (event) => event.stopPropagation?.() }, R.createElement('strong', null, '更新完成'), R.createElement('p', { style: styles.muted }, updateDone), R.createElement('div', { style: styles.actions }, R.createElement('button', { style: styles.primary, onClick: () => setUpdateDone(null) }, '知道了'))))
590
594
  : null);
591
595
  }
592
596
  function apply(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandablessing/dsh-user-sync",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "DSH用户级配置同步插件,更新需重启DSH",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",