mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 14:43:52 +03:00
Backport #29684 by @silverwind Fixes: https://github.com/go-gitea/gitea/issues/29414 I see no way for us to catch this error, so downgrade it until https://github.com/microsoft/monaco-editor/issues/4325 is fixed, which will likely take a few weeks to propagate up from vscode. The entries in `updates.config.js` will make [`updates`](https://github.com/silverwind/updates) not upgrade these anymore and I think it's good documentation as well to have the reasons why we don't upgrade these dependencies. Co-authored-by: silverwind <me@silverwind.io> (cherry picked from commit 462ae88fc2e6295a9376855627ad2a824a6c8f1d)
This commit is contained in:
parent
fefe6062b0
commit
73498c1622
1 changed files with 8 additions and 0 deletions
8
web_src/js/bootstrap.js
vendored
8
web_src/js/bootstrap.js
vendored
|
@ -6,10 +6,18 @@
|
||||||
// This file must be imported before any lazy-loading is being attempted.
|
// This file must be imported before any lazy-loading is being attempted.
|
||||||
__webpack_public_path__ = `${window.config?.assetUrlPrefix ?? '/assets'}/`;
|
__webpack_public_path__ = `${window.config?.assetUrlPrefix ?? '/assets'}/`;
|
||||||
|
|
||||||
|
const filteredErrors = new Set([
|
||||||
|
'getModifierState is not a function', // https://github.com/microsoft/monaco-editor/issues/4325
|
||||||
|
]);
|
||||||
|
|
||||||
export function showGlobalErrorMessage(msg) {
|
export function showGlobalErrorMessage(msg) {
|
||||||
const pageContent = document.querySelector('.page-content');
|
const pageContent = document.querySelector('.page-content');
|
||||||
if (!pageContent) return;
|
if (!pageContent) return;
|
||||||
|
|
||||||
|
for (const filteredError of filteredErrors) {
|
||||||
|
if (msg.includes(filteredError)) return;
|
||||||
|
}
|
||||||
|
|
||||||
// compact the message to a data attribute to avoid too many duplicated messages
|
// compact the message to a data attribute to avoid too many duplicated messages
|
||||||
const msgCompact = msg.replace(/\W/g, '').trim();
|
const msgCompact = msg.replace(/\W/g, '').trim();
|
||||||
let msgDiv = pageContent.querySelector(`.js-global-error[data-global-error-msg-compact="${msgCompact}"]`);
|
let msgDiv = pageContent.querySelector(`.js-global-error[data-global-error-msg-compact="${msgCompact}"]`);
|
||||||
|
|
Loading…
Reference in a new issue