@@ -163,7 +163,14 @@ export default defineComponent({
163163 if (this .filesListWidth < 768 || this .gridMode ) {
164164 return []
165165 }
166- return this .enabledFileActions .filter (action => action ?.inline ?.(this .source , this .currentView ))
166+ return this .enabledFileActions .filter (action => {
167+ try {
168+ return action ?.inline ?.(this .source , this .currentView )
169+ } catch (error ) {
170+ logger .error (' Error while checking if action is inline' , { action , error })
171+ return false
172+ }
173+ })
167174 },
168175
169176 // Enabled action that are displayed inline with a custom render function
@@ -236,13 +243,19 @@ export default defineComponent({
236243
237244 methods: {
238245 actionDisplayName(action : FileAction ) {
239- if ((this .gridMode || (this .filesListWidth < 768 && action .inline )) && typeof action .title === ' function' ) {
240- // if an inline action is rendered in the menu for
241- // lack of space we use the title first if defined
242- const title = action .title ([this .source ], this .currentView )
243- if (title ) return title
246+ try {
247+ if ((this .gridMode || (this .filesListWidth < 768 && action .inline )) && typeof action .title === ' function' ) {
248+ // if an inline action is rendered in the menu for
249+ // lack of space we use the title first if defined
250+ const title = action .title ([this .source ], this .currentView )
251+ if (title ) return title
252+ }
253+ return action .displayName ([this .source ], this .currentView )
254+ } catch (error ) {
255+ logger .error (' Error while getting action display name' , { action , error })
256+ // Not ideal, but better than nothing
257+ return action .id
244258 }
245- return action .displayName ([this .source ], this .currentView )
246259 },
247260
248261 async onActionClick(action , isSubmenu = false ) {
@@ -257,7 +270,13 @@ export default defineComponent({
257270 return
258271 }
259272
260- const displayName = action .displayName ([this .source ], this .currentView )
273+ let displayName = action .id
274+ try {
275+ displayName = action .displayName ([this .source ], this .currentView )
276+ } catch (error ) {
277+ logger .error (' Error while getting action display name' , { action , error })
278+ }
279+
261280 try {
262281 // Set the loading marker
263282 this .$emit (' update:loading' , action .id )
@@ -275,8 +294,8 @@ export default defineComponent({
275294 return
276295 }
277296 showError (t (' files' , ' "{displayName}" action failed' , { displayName }))
278- } catch (e ) {
279- logger .error (' Error while executing action' , { action , e })
297+ } catch (error ) {
298+ logger .error (' Error while executing action' , { action , error })
280299 showError (t (' files' , ' "{displayName}" action failed' , { displayName }))
281300 } finally {
282301 // Reset the loading marker
0 commit comments