Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit faedb56

Browse files
authored
Merge pull request #87 from SpringRoll/release/1.8.0
Release/1.8.0
2 parents eab2775 + 7ceabd2 commit faedb56

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

app/public/js/embed.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/public/js/libraries.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ const start = () => {
170170
playOptions,
171171
query: queryArgs.length ? '?' + queryArgs.join('&') : ''
172172
})
173-
.catch(err => err.json())
174-
.then(({ error }) => alert(error));
173+
.catch(err => {
174+
err.json().then(({ error }) => alert(error));
175+
})
175176
};
176177

177178
start();

src/widgets/version-to-commit.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@ window.addEventListener('load', () => {
33
'.navbar-brand .version'
44
);
55

6+
if (versionAndCommitButton === null) {
7+
return;
8+
}
9+
610
const version = versionAndCommitButton.dataset.ver;
7-
let commitID = versionAndCommitButton.dataset.commit;
11+
const commitID = versionAndCommitButton.dataset.commit;
812

9-
if (version && commitID) {
10-
commitID = commitID.slice(0, 7);
11-
versionAndCommitButton.addEventListener('click', function() {
12-
if (versionAndCommitButton.textContent === version) {
13-
versionAndCommitButton.textContent = commitID;
14-
} else {
15-
versionAndCommitButton.textContent = version;
16-
}
17-
});
13+
if (!version || !commitID) {
14+
return;
1815
}
16+
17+
versionAndCommitButton.addEventListener('click', function() {
18+
if (versionAndCommitButton.textContent === version) {
19+
versionAndCommitButton.textContent = commitID.slice(0, 7);
20+
} else {
21+
versionAndCommitButton.textContent = version;
22+
}
23+
});
1924
});

0 commit comments

Comments
 (0)