Skip to content

Commit dc4b572

Browse files
author
Alberto Iannaccone
committed
fix how the old changelog is cut off
1 parent 4713ba7 commit dc4b572

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arduino-ide-extension/src/electron-main/ide-updater/ide-updater-impl.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ export class IDEUpdaterImpl implements IDEUpdater {
8181
? await fetch(`${CHANGELOG_BASE_URL}/${latestChangelogFileName}`)
8282
: null;
8383
const changelog = response?.ok ? await response?.text() : null;
84-
84+
const currentVersionHeader = `\n\n---\n\n## ${this.updater.currentVersion}\n\n`;
8585
// We only want to see the release notes of newer versions
86-
const currentVersionIndex = changelog?.indexOf(
87-
`\r\n\r\n---\r\n\r\n## ${this.updater.currentVersion}\r\n\r\n`
88-
);
86+
const currentVersionIndex = changelog?.indexOf(currentVersionHeader);
8987
const newChangelog =
9088
currentVersionIndex && currentVersionIndex > 0
9189
? changelog?.slice(0, currentVersionIndex)

0 commit comments

Comments
 (0)