Fix style

This commit is contained in:
Shyam Sunder 2021-09-13 13:26:57 -04:00
parent 516b3a51a7
commit f5338ca508
2 changed files with 25 additions and 19 deletions

View File

@ -65,13 +65,15 @@ class PostUploadController {
uploadable, uploadable,
e.detail.skipDuplicates, e.detail.skipDuplicates,
e.detail.alwaysUploadSimilar e.detail.alwaysUploadSimilar
) ).catch((error) => {
.catch((error) => {
anyFailures = true; anyFailures = true;
if (error.uploadable) { if (error.uploadable) {
if (error.similarPosts) { if (error.similarPosts) {
error.uploadable.lookalikes = error.similarPosts; error.uploadable.lookalikes =
this._view.updateUploadable(error.uploadable); error.similarPosts;
this._view.updateUploadable(
error.uploadable
);
this._view.showInfo( this._view.showInfo(
error.message, error.message,
error.uploadable error.uploadable
@ -92,8 +94,7 @@ class PostUploadController {
), ),
Promise.resolve() Promise.resolve()
) )
.then( .then(() => {
() => {
if (anyFailures) { if (anyFailures) {
this._view.showError(genericErrorMessage); this._view.showError(genericErrorMessage);
this._view.enableForm(); this._view.enableForm();
@ -103,8 +104,7 @@ class PostUploadController {
const ctx = router.show(uri.formatClientLink("posts")); const ctx = router.show(uri.formatClientLink("posts"));
ctx.controller.showSuccess("Posts uploaded."); ctx.controller.showSuccess("Posts uploaded.");
} }
} });
);
} }
_uploadSinglePost(uploadable, skipDuplicates, alwaysUploadSimilar) { _uploadSinglePost(uploadable, skipDuplicates, alwaysUploadSimilar) {
@ -136,7 +136,10 @@ class PostUploadController {
} }
// notify about similar posts // notify about similar posts
if (searchResult.similarPosts.length && !alwaysUploadSimilar) { if (
searchResult.similarPosts.length &&
!alwaysUploadSimilar
) {
let error = new Error( let error = new Error(
`Found ${searchResult.similarPosts.length} similar ` + `Found ${searchResult.similarPosts.length} similar ` +
"posts.\nYou can resume or discard this upload." "posts.\nYou can resume or discard this upload."

View File

@ -350,7 +350,8 @@ class PostUploadView extends events.EventTarget {
detail: { detail: {
uploadables: this._uploadables, uploadables: this._uploadables,
skipDuplicates: this._skipDuplicatesCheckboxNode.checked, skipDuplicates: this._skipDuplicatesCheckboxNode.checked,
alwaysUploadSimilar: this._alwaysUploadSimilarCheckboxNode.checked, alwaysUploadSimilar: this._alwaysUploadSimilarCheckboxNode
.checked,
}, },
}) })
); );
@ -415,7 +416,9 @@ class PostUploadView extends events.EventTarget {
} }
get _alwaysUploadSimilarCheckboxNode() { get _alwaysUploadSimilarCheckboxNode() {
return this._hostNode.querySelector("form [name=always-upload-similar]"); return this._hostNode.querySelector(
"form [name=always-upload-similar]"
);
} }
get _submitButtonNode() { get _submitButtonNode() {