Show proper error if the file doesn't have a handler#570
Merged
Conversation
Member
skjnldsv
commented
Aug 19, 2020

Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
juliusknorr
reviewed
Aug 19, 2020
| console.error('The following file could not be displayed', fileName, fileInfo) | ||
| showError(t('viewer', 'There is no plugin available to display this file type')) | ||
| this.close() | ||
| return |
Member
There was a problem hiding this comment.
Is there a way to check that upfront as an app calling openFile?
Member
Author
There was a problem hiding this comment.
Unless we use the filename to detect type, unfortunately no.
I started by doing this, but in the end nextcloud server have different mimetypes than some libraries you can find (and apps can register custom ones)
Unless we have a dedicated service that allow us to match the mimetype against server, I don't see how I can do it without :/
juliusknorr
approved these changes
Aug 25, 2020
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
93bf685 to
c9fe0b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.