Skip to content

Commit

Permalink
[Freestyler] Remove last loading step on error
Browse files Browse the repository at this point in the history
We may want to change the step to error instead,
but more often it's empty so we add no value for now.

Fixed: 369307147
Change-Id: I029d3dd9835b78de5f49b80a8763e36b6aa7def0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5904882
Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
  • Loading branch information
Lightning00Blade authored and Devtools-frontend LUCI CQ committed Oct 2, 2024
1 parent 4c36445 commit 950588f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions front_end/panels/freestyler/FreestylerPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,16 +401,18 @@ export class FreestylerPanel extends UI.Panel.Panel {
}

case ResponseType.ERROR: {
step.isLoading = false;
systemMessage.error = data.error;
systemMessage.suggestions = [];
systemMessage.rpcId = undefined;
this.#viewProps.isLoading = false;
if (data.error === ErrorType.ABORT) {
const lastStep = systemMessage.steps.at(-1);
const lastStep = systemMessage.steps.at(-1);
if (lastStep) {
// Mark the last step as cancelled to make the UI feel better.
if (lastStep) {
if (data.error === ErrorType.ABORT) {
lastStep.canceled = true;
// If error happens while the step is still loading remove it.
} else if (lastStep.isLoading) {
systemMessage.steps.pop();
}
}
}
Expand Down

0 comments on commit 950588f

Please sign in to comment.