summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Rohlfs <brohlfs@google.com>2023-05-04 11:40:32 +0200
committerPaladox none <thomasmulhall410@yahoo.com>2023-05-04 11:14:57 +0000
commit31771d3f71800d823323c1163c1847b968224f95 (patch)
treeab30612854e4a626c7653e5bd4c2197f843b43f4
parente8c935ebe69fbb807be4525d7b8dd6c3904e785e (diff)
Do not show a `Saving drafts...` toast while saving comments
This is rather just distracting than helpful. Release-Notes: skip Change-Id: I74234ad51a18079745ca745b781d6ced741fe1ed (cherry picked from commit 10a33343ec4b36157ca17fb29828c0cf7de23842)
-rw-r--r--polygerrit-ui/app/models/comments/comments-model.ts11
1 files changed, 3 insertions, 8 deletions
diff --git a/polygerrit-ui/app/models/comments/comments-model.ts b/polygerrit-ui/app/models/comments/comments-model.ts
index ac832a193d..eca8b7c529 100644
--- a/polygerrit-ui/app/models/comments/comments-model.ts
+++ b/polygerrit-ui/app/models/comments/comments-model.ts
@@ -41,7 +41,6 @@ import {ChangeModel} from '../change/change-model';
import {Interaction, Timing} from '../../constants/reporting';
import {assert, assertIsDefined} from '../../utils/common-util';
import {debounce, DelayedTask} from '../../utils/async-util';
-import {pluralize} from '../../utils/string-util';
import {ReportingService} from '../../services/gr-reporting/gr-reporting';
import {Model} from '../model';
import {Deduping} from '../../api/reporting';
@@ -98,7 +97,7 @@ function getSavingMessage(numPending: number, requestFailed?: boolean) {
if (numPending === 0) {
return 'All changes saved';
}
- return `Saving ${pluralize(numPending, 'draft')}...`;
+ return undefined;
}
// Private but used in tests.
@@ -759,14 +758,10 @@ export class CommentsModel extends Model<CommentState> {
this.numPendingDraftRequests,
requestFailed
);
+ if (!message) return;
this.draftToastTask = debounce(
this.draftToastTask,
- () => {
- // Note: the event is fired on the body rather than this element because
- // this element may not be attached by the time this executes, in which
- // case the event would not bubble.
- fireAlert(document.body, message);
- },
+ () => fireAlert(document.body, message),
TOAST_DEBOUNCE_INTERVAL
);
}