From 3e6eef757c602bedaec114693dead6b6d8bce375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Fri, 16 Aug 2024 13:10:54 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E6=9B=B4=E6=96=B0=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/bridge/update/backend.js | 2 +- packages/gui/src/bridge/update/front.js | 24 +++++++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/gui/src/bridge/update/backend.js b/packages/gui/src/bridge/update/backend.js index bd5b680c..9fcae267 100644 --- a/packages/gui/src/bridge/update/backend.js +++ b/packages/gui/src/bridge/update/backend.js @@ -203,7 +203,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) { value: { version, releaseNotes: versionData.body - ? (versionData.body.replace(/\r\n/g, '\n').replace(/https:\/\/github.com\/docmirror\/dev-sidecar/g, '').replace(/(?<=(^|\n))[ \t]*[ #]+/g, '') || '无') + ? (versionData.body.replace(/\r\n/g, '\n').replace(/https:\/\/github.com\/docmirror\/dev-sidecar/g, '').replace(/(?<=(^|\n))[ \t]*[ #]*#\s*/g, '') || '无') : '无' } }) diff --git a/packages/gui/src/bridge/update/front.js b/packages/gui/src/bridge/update/front.js index 85a0aadf..f9330f1b 100644 --- a/packages/gui/src/bridge/update/front.js +++ b/packages/gui/src/bridge/update/front.js @@ -144,21 +144,18 @@ function install (app, api) { title: '发现新版本:v' + value.version, cancelText: '暂不升级', okText: '升级', - width: 550, + width: 650, content: h => { if (value.releaseNotes) { const notes = [] if (typeof value.releaseNotes === 'string') { - const releaseNotes = value.releaseNotes.replace(/\r?\n/g, '\n').split('\n') - for (const note of releaseNotes) { - notes.push(
{note}
) - } + const releaseNotes = value.releaseNotes.replace(/\r\n/g, '\n') return
发布公告:https://github.com/docmirror/dev-sidecar/releases
更新内容:
-
- {notes} -
+
+                {releaseNotes}
+              
} else { for (const note of value.releaseNotes) { @@ -194,16 +191,13 @@ function install (app, api) { if (value.releaseNotes) { const notes = [] if (typeof value.releaseNotes === 'string') { - const releaseNotes = value.releaseNotes.replace(/\r?\n/g, '\n').split('\n') - for (const note of releaseNotes) { - notes.push(
{note}
) - } + const releaseNotes = value.releaseNotes.replace(/\r\n/g, '\n') return
发布公告:https://github.com/docmirror/dev-sidecar/releases
更新内容:
-
- {notes} -
+
+                {releaseNotes}
+              
} else { for (const note of value.releaseNotes) {