Commit 63b8c30f authored by Ben Wells's avatar Ben Wells Committed by Commit Bot

Only show the first error to the user in the Crostini setup flow.

The CrostiniManager can send multiple error callbacks. Only the first
one should be shown to the user.

Bug: 841158
Change-Id: If21222f81b609559a462a73af8c5a7bc911592fb
Reviewed-on: https://chromium-review.googlesource.com/1051406
Commit-Queue: Ben Wells <benwells@chromium.org>
Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557477}
parent 4e402944
......@@ -183,6 +183,12 @@ void CrostiniInstallerView::StepProgress() {
void CrostiniInstallerView::HandleError(const base::string16& error_message,
SetupResult result) {
// Only ever set the error once. This check is necessary as the
// CrostiniManager can give multiple error callbacks. Only the first should be
// shown to the user.
if (state_ == State::ERROR)
return;
RecordSetupResultHistogram(result);
state_ = State::ERROR;
message_label_->SetVisible(true);
......
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