Skip to content

Commit dc462eb

Browse files
committed
fix: Try fixing too late handler registration for file actions
Signed-off-by: Julius Knorr <jus@bitgrid.net>
1 parent c73fa32 commit dc462eb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/init.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ registerViewerAction()
1212
window.OCA = window.OCA ?? {}
1313
window.OCA.Viewer = new ViewerService()
1414
window.OCA.Viewer.version = appVersion
15+
16+
// Eagerly register any handlers queued before the viewer was initialized.
17+
// This must happen synchronously so that OCA.Viewer.mimetypes is complete
18+
// before the file action's enabled() callback is evaluated by the files app.
19+
if (window._oca_viewer_handlers) {
20+
window._oca_viewer_handlers.forEach(handler => window.OCA.Viewer.registerHandler(handler))
21+
}

0 commit comments

Comments
 (0)