Commit 080559c7 authored by Gavin Williams's avatar Gavin Williams Committed by Chromium LUCI CQ

scanning: Show scan failed dialog when no scanned images received

Move the logic to check the number of scanned images from the scan
preview page to when the scan completes. This fits more with the app
flow and simplifies the show boolean logic for the scan preview page.

Bug: 1059779
Change-Id: Ie742166ddd3d4ff2f79c3461428c0b88bef25544
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587105
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: default avatarJesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836653}
parent 14c3a5af
...@@ -102,13 +102,11 @@ Polymer({ ...@@ -102,13 +102,11 @@ Polymer({
/** @private */ /** @private */
onAppStateChange_() { onAppStateChange_() {
this.showScannedImages_ = this.showScannedImages_ = this.appState === AppState.DONE;
this.appState === AppState.DONE && this.objectUrls.length > 0; this.showScanProgress_ = this.appState === AppState.SCANNING;
this.showScanProgress_ =
this.appState === AppState.SCANNING || this.appState === AppState.DONE;
this.showCancelingProgress_ = this.appState === AppState.CANCELING; this.showCancelingProgress_ = this.appState === AppState.CANCELING;
this.showHelperText_ = this.showHelperText_ = !this.showScanProgress_ &&
!this.showScanProgress_ && !this.showCancelingProgress_; !this.showCancelingProgress_ && !this.showScannedImages_;
}, },
/** @private */ /** @private */
......
...@@ -271,7 +271,7 @@ Polymer({ ...@@ -271,7 +271,7 @@ Polymer({
* @param {!mojoBase.mojom.FilePath} lastScannedFilePath * @param {!mojoBase.mojom.FilePath} lastScannedFilePath
*/ */
onScanComplete(success, lastScannedFilePath) { onScanComplete(success, lastScannedFilePath) {
if (!success) { if (!success || this.objectUrls_.length == 0) {
this.$.scanFailedDialog.showModal(); this.$.scanFailedDialog.showModal();
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment