chore(cleanup): format code and move from js-beautify to prettier

This commit is contained in:
Joxit
2022-04-09 00:02:52 +02:00
parent ab12cceefc
commit 49fcba3f6c
21 changed files with 373 additions and 302 deletions

View File

@@ -96,10 +96,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
onAuthentication: props.onAuthentication,
});
oReq.addEventListener('load', function () {
if (this.status == 200) {
if (this.status === 200) {
const nbTags = (JSON.parse(this.responseText).tags || []).length;
self.update({ nbTags });
} else if (this.status == 404) {
} else if (this.status === 404) {
props.onNotify('Server not found', true);
} else {
props.onNotify(this.responseText, true);

View File

@@ -73,14 +73,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
onAuthentication: this.props.onAuthentication,
});
oReq.addEventListener('load', function () {
if (this.status == 200) {
if (this.status === 200) {
repositories = JSON.parse(this.responseText).repositories || [];
repositories.sort();
repositories = repositories.reduce(function (acc, e) {
const slash = e.indexOf('/');
if (slash > 0) {
const repoName = e.substring(0, slash) + '/';
if (acc.length == 0 || acc[acc.length - 1].repo != repoName) {
if (acc.length === 0 || acc[acc.length - 1].repo != repoName) {
acc.push({
repo: repoName,
images: [],
@@ -92,7 +92,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
acc.push(e);
return acc;
}, []);
} else if (this.status == 404) {
} else if (this.status === 404) {
self.props.onNotify('Server not found', true);
} else {
self.props.onNotify(this.responseText);