diff options
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/render_mermaid.js | 10 | ||||
-rw-r--r-- | app/assets/javascripts/behaviors/preview_markdown.js | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index 5fecadf2794..293fe9f4133 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import { once, countBy } from 'lodash'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import { darkModeEnabled } from '~/lib/utils/color_utils'; import { __, sprintf } from '~/locale'; @@ -78,7 +78,9 @@ function importMermaidModule() { mermaidModule = initMermaid(mermaid); }) .catch((err) => { - flash(sprintf(__("Can't load mermaid module: %{err}"), { err })); + createFlash({ + message: sprintf(__("Can't load mermaid module: %{err}"), { err }), + }); // eslint-disable-next-line no-console console.error(err); }); @@ -205,7 +207,9 @@ function renderMermaids($els) { }); }) .catch((err) => { - flash(sprintf(__('Encountered an error while rendering: %{err}'), { err })); + createFlash({ + message: sprintf(__('Encountered an error while rendering: %{err}'), { err }), + }); // eslint-disable-next-line no-console console.error(err); }); diff --git a/app/assets/javascripts/behaviors/preview_markdown.js b/app/assets/javascripts/behaviors/preview_markdown.js index 5405819cfe0..a1911585f80 100644 --- a/app/assets/javascripts/behaviors/preview_markdown.js +++ b/app/assets/javascripts/behaviors/preview_markdown.js @@ -1,7 +1,7 @@ /* eslint-disable func-names */ import $ from 'jquery'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { __ } from '~/locale'; @@ -79,7 +79,11 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function (text, url, success) { }; success(data); }) - .catch(() => flash(__('An error occurred while fetching markdown preview'))); + .catch(() => + createFlash({ + message: __('An error occurred while fetching markdown preview'), + }), + ); }; MarkdownPreview.prototype.hideReferencedUsers = function ($form) { |