feat(MediaManager): enhance viewer options for SVG files in availableViewers function
This commit is contained in:
parent
1d2690efa4
commit
c0d45e33f0
|
|
@ -92,8 +92,9 @@ function defaultViewMode(entry: EntryInfo): ViewMode {
|
||||||
|
|
||||||
function availableViewers(entry: EntryInfo): ViewMode[] {
|
function availableViewers(entry: EntryInfo): ViewMode[] {
|
||||||
const def = defaultViewMode(entry);
|
const def = defaultViewMode(entry);
|
||||||
|
const ext = entry.name.split('.').pop()?.toLowerCase() ?? '';
|
||||||
const map: Record<ViewMode, ViewMode[]> = {
|
const map: Record<ViewMode, ViewMode[]> = {
|
||||||
image: ['image', 'hex'],
|
image: ext === 'svg' ? ['image', 'xml', 'hex'] : ['image', 'hex'],
|
||||||
config: ['config', 'text', 'hex'],
|
config: ['config', 'text', 'hex'],
|
||||||
markdown: ['markdown', 'text', 'hex'],
|
markdown: ['markdown', 'text', 'hex'],
|
||||||
json: ['json', 'text', 'hex'],
|
json: ['json', 'text', 'hex'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user