Skip to content

Commit

Permalink
Fix aliasing mimes
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv committed Nov 9, 2022
1 parent 2d0eebf commit 257690e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -542,18 +542,18 @@ export default {
}
// If no provided handler, or provided handler not found: try a supported handler with mime/mime-alias
if (!handler) {
handler = this.registeredHandlers[mime] ?? this.registeredHandlers[alias]
}
handler = this.registeredHandlers[alias] ?? this.registeredHandlers[mime]
this.theme = handler.theme ?? 'dark'
// if we don't have a handler for this mime, abort
if (!handler) {
logger.error('The following file could not be displayed', { fileInfo })
showError(t('viewer', 'There is no plugin available to display this file type'))
this.close()
return
// if we still don't have a handler for this mime, abort
if (!handler) {
logger.error('The following file could not be displayed', { fileInfo })
showError(t('viewer', 'There is no plugin available to display this file type'))
this.close()
return
}
}
this.theme = handler.theme ?? 'dark'
this.handlerId = handler.id
// check if part of a group, if so retrieve full files list
Expand Down Expand Up @@ -595,7 +595,7 @@ export default {
fileInfo = this.fileList[this.currentIndex]
// show file
this.currentFile = new File(fileInfo, mime, handler.component)
this.currentFile = new File(fileInfo, mime, this.components[mime])
this.updatePreviousNext()
// if sidebar was opened before, let's update the file
Expand Down Expand Up @@ -752,7 +752,7 @@ export default {
this.components[mime] = this.components[alias]
// set the handler as registered
this.registeredHandlers[mime] = handler
this.registeredHandlers[mime] = this.registeredHandlers[alias]
})
}
},
Expand Down

0 comments on commit 257690e

Please sign in to comment.