@samitouri / QOSami-HFS / commits / 575be5e8

fix: win+click shouldn't open file-show for files that are not supported

Massimo Melina committed Jul 7, 2024 at 00:58 UTC 575be5e80b48525b4fc4e53c69ffdb60bcd60709
2 files changed +3 -14
frontend/src/BrowseFiles.ts
+2 -2
@@ -16,7 +16,7 @@ import _ from 'lodash'
16 import { t, useI18N } from './i18n'
17 import { makeOnClickOpen, openFileMenu } from './fileMenu'
18 import { ClipBar } from './clip'
19 -import { fileShow } from './show'
19 +import { fileShow, getShowType } from './show'
20
21 export const MISSING_PERM = "Missing permission"
22
@@ -248,7 +248,7 @@ const Entry = ({ entry, midnight, separator }: EntryProps) => {
248 if (ev.altKey || ev.ctrlKey || isMac && ev.metaKey) return
249 ev.preventDefault()
250 const special = isMac ? ev.shiftKey : ev.metaKey
251 - if (special)
251 + if (special && getShowType(entry))
252 return fileShow(entry, { startPlaying: true })
253 openFileMenu(entry, ev, onlyTruthy([
254 file_menu_on_link && 'open',
src/listen.ts
+1 -12
@@ -8,18 +8,7 @@ import { watchLoad } from './watchLoad'
8 import { networkInterfaces } from 'os';
9 import { newConnection } from './connections'
10 import open from 'open'
11 -import {
12 - debounceAsync,
13 - ipForUrl,
14 - makeNetMatcher,
15 - MINUTE,
16 - objSameKeys,
17 - onlyTruthy,
18 - prefix,
19 - runAt,
20 - wait,
21 - waitFor
22 -} from './misc'
11 +import { debounceAsync, ipForUrl, makeNetMatcher, MINUTE, objSameKeys, onlyTruthy, prefix, runAt, wait, } from './misc'
12 import { PORT_DISABLED, ADMIN_URI, argv, DEV, IS_WINDOWS } from './const'
13 import findProcess from 'find-process'
14 import { anyAccountCanLoginAdmin } from './adminApis'