Commit bc753559 authored by Winnie Hellmann's avatar Winnie Hellmann

Handle errors in successful notes reply

parent 0625ccc6
......@@ -268,11 +268,20 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
const { errors } = res;
const commandsChanges = res.commands_changes;
if (hasQuickActions && errors && Object.keys(errors).length) {
eTagPoll.makeRequest();
if (errors && Object.keys(errors).length) {
/*
The following reply means that quick actions have been successfully applied:
$('.js-gfm-input').trigger('clear-commands-cache.atwho');
Flash(__('Commands applied'), 'notice', noteData.flashContainer);
{"commands_changes":{},"valid":false,"errors":{"commands_only":["Commands applied"]}}
*/
if (hasQuickActions) {
eTagPoll.makeRequest();
$('.js-gfm-input').trigger('clear-commands-cache.atwho');
Flash(__('Commands applied'), 'notice', noteData.flashContainer);
} else {
throw new Error(__('Failed to save comment!'));
}
}
if (commandsChanges) {
......
---
title: Handle errors in successful notes reply
merge_request: 28082
author:
type: fixed
......@@ -4196,6 +4196,9 @@ msgstr ""
msgid "Failed to remove user key."
msgstr ""
msgid "Failed to save comment!"
msgstr ""
msgid "Failed to save merge conflicts resolutions. Please try again!"
msgstr ""
......
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