From 586e3060e4a574511abd72423a9515466ea325e2 Mon Sep 17 00:00:00 2001 From: Diego Echeverri Date: Tue, 13 May 2025 23:01:18 +0200 Subject: [PATCH] Handle promise rejection exceptions from actionSheet (#6817) * Add catches to jellyfin * Undo format changes to actionSheet * formatting * Remove logging * commented block for screenshot * Handle another case * weird indentation fix * Add myself as a contributor --- CONTRIBUTORS.md | 1 + src/components/directorybrowser/directorybrowser.js | 4 +++- src/controllers/session/selectServer/index.js | 4 ++-- src/scripts/libraryBrowser.js | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d53caedaa..ccecf844a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -98,6 +98,7 @@ - [Jxiced](https://github.com/Jxiced) - [Derek Huber](https://github.com/Derek4aty1) - [StableCrimson](https://github.com/StableCrimson) +- [diegoeche](https://github.com/diegoeche) ## Emby Contributors diff --git a/src/components/directorybrowser/directorybrowser.js b/src/components/directorybrowser/directorybrowser.js index a652e6ae4..133c66380 100644 --- a/src/components/directorybrowser/directorybrowser.js +++ b/src/components/directorybrowser/directorybrowser.js @@ -212,7 +212,9 @@ function initEditor(content, options, fileOptions) { let networkSharePath = this.querySelector('#txtNetworkPath'); networkSharePath = networkSharePath ? networkSharePath.value : null; const path = this.querySelector('#txtDirectoryPickerPath').value; - validatePath(path, options.validateWriteable, ApiClient).then(options.callback(path, networkSharePath)); + validatePath(path, options.validateWriteable, ApiClient).then( + options.callback(path, networkSharePath) + ).catch(() => { /* no-op */ }); } e.preventDefault(); e.stopPropagation(); diff --git a/src/controllers/session/selectServer/index.js b/src/controllers/session/selectServer/index.js index 3ed198677..3b2efb082 100644 --- a/src/controllers/session/selectServer/index.js +++ b/src/controllers/session/selectServer/index.js @@ -175,8 +175,9 @@ export default function (view, params) { case 'delete': deleteServer(server); + break; } - }); + }).catch(() => { /* no-op */ }); } function onServersRetrieved(result) { @@ -221,4 +222,3 @@ export default function (view, params) { } }); } - diff --git a/src/scripts/libraryBrowser.js b/src/scripts/libraryBrowser.js index 9411109b0..830311e51 100644 --- a/src/scripts/libraryBrowser.js +++ b/src/scripts/libraryBrowser.js @@ -34,7 +34,7 @@ export function showLayoutMenu (button, currentLayout, views) { $(button).trigger('layoutchange', [id]); } } - }); + }).catch(() => { /* no-op */ }); }); }