-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid handlers are still listed in OC.Viewer.availableHandlers
#912
Comments
Oh right, it should not! |
Lines 525 to 529 in 267797a
EDIT: Lines 68 to 71 in de081e5
|
Please link me some code? |
Thanks for the quick response @skjnldsv 😃 We fixed the issue on our end by coming up with a more robust way of selecting the text app handler: handler() {
return OCA.Viewer.availableHandlers.find(h => h.id === 'text')
}, Before we were checking This issue is mainly meant to track the unexpected behavior we were seeing. |
Please don't do that. I cannot guarantee the stability of your code nor can inform you when it will break on your app. |
@skjnldsv What would that proper API look like?
But without the modal one would need to specify where to render the viewer. So maybe something like
But i still don't understand how that would work. Right now the I suspect this
Does that sound like what you had in mind? |
This looks rather nice :) |
That would require a slightly different logic. Just have a proper Vue.extend of the |
@StefCGN should probably be a warning for the first two. |
@skjnldsv Please have a look here. |
For the DOMContentLoaded one: #1079 |
Means? You are working on? |
@max-nextcloud Could you up on the new viewer API proposal to render the viewer without the modal in a given element? That would clean up the handling significantly. No more need to inspect the availableHandlers. |
Long time no see ;) In the meantime:
But the initial report in this issue still holds true: So I'll prepare a PR that fixes it as proposed in #912 (comment) |
Fixes #912 Signed-off-by: Max <[email protected]>
Fixes #912 Signed-off-by: Max <[email protected]>
Fixes #912 Signed-off-by: Max <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
Describe the bug
OCA.Viewer.registerHandler({})
will add a handler withoutid
ormimes
toOCA.Viewer.availableHandlers
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Invalid handlers should not be added to the available handlers.
Desktop (please complete the following information):
Additional context
We're using the
availableHandlers
in the Collectives app to open markdown files in a viewer component. This is hacky and probably not the intended way of using this API. However adding an invalid handler to the list of availableHandlers still seems like an error.The text was updated successfully, but these errors were encountered: