Fix style
This commit is contained in:
parent
516b3a51a7
commit
f5338ca508
2 changed files with 25 additions and 19 deletions
|
@ -65,13 +65,15 @@ class PostUploadController {
|
|||
uploadable,
|
||||
e.detail.skipDuplicates,
|
||||
e.detail.alwaysUploadSimilar
|
||||
)
|
||||
.catch((error) => {
|
||||
).catch((error) => {
|
||||
anyFailures = true;
|
||||
if (error.uploadable) {
|
||||
if (error.similarPosts) {
|
||||
error.uploadable.lookalikes = error.similarPosts;
|
||||
this._view.updateUploadable(error.uploadable);
|
||||
error.uploadable.lookalikes =
|
||||
error.similarPosts;
|
||||
this._view.updateUploadable(
|
||||
error.uploadable
|
||||
);
|
||||
this._view.showInfo(
|
||||
error.message,
|
||||
error.uploadable
|
||||
|
@ -92,8 +94,7 @@ class PostUploadController {
|
|||
),
|
||||
Promise.resolve()
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
.then(() => {
|
||||
if (anyFailures) {
|
||||
this._view.showError(genericErrorMessage);
|
||||
this._view.enableForm();
|
||||
|
@ -103,8 +104,7 @@ class PostUploadController {
|
|||
const ctx = router.show(uri.formatClientLink("posts"));
|
||||
ctx.controller.showSuccess("Posts uploaded.");
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
_uploadSinglePost(uploadable, skipDuplicates, alwaysUploadSimilar) {
|
||||
|
@ -136,7 +136,10 @@ class PostUploadController {
|
|||
}
|
||||
|
||||
// notify about similar posts
|
||||
if (searchResult.similarPosts.length && !alwaysUploadSimilar) {
|
||||
if (
|
||||
searchResult.similarPosts.length &&
|
||||
!alwaysUploadSimilar
|
||||
) {
|
||||
let error = new Error(
|
||||
`Found ${searchResult.similarPosts.length} similar ` +
|
||||
"posts.\nYou can resume or discard this upload."
|
||||
|
|
|
@ -350,7 +350,8 @@ class PostUploadView extends events.EventTarget {
|
|||
detail: {
|
||||
uploadables: this._uploadables,
|
||||
skipDuplicates: this._skipDuplicatesCheckboxNode.checked,
|
||||
alwaysUploadSimilar: this._alwaysUploadSimilarCheckboxNode.checked,
|
||||
alwaysUploadSimilar: this._alwaysUploadSimilarCheckboxNode
|
||||
.checked,
|
||||
},
|
||||
})
|
||||
);
|
||||
|
@ -415,7 +416,9 @@ class PostUploadView extends events.EventTarget {
|
|||
}
|
||||
|
||||
get _alwaysUploadSimilarCheckboxNode() {
|
||||
return this._hostNode.querySelector("form [name=always-upload-similar]");
|
||||
return this._hostNode.querySelector(
|
||||
"form [name=always-upload-similar]"
|
||||
);
|
||||
}
|
||||
|
||||
get _submitButtonNode() {
|
||||
|
|
Loading…
Reference in a new issue