Quicklook only for local files on mac (#1039)

bug fix so quicklook does attempt to launch for remote directory
previews
This commit is contained in:
Sylvie Crowe 2024-10-16 09:24:22 -07:00 committed by GitHub
parent 69c99dd13a
commit 0b3888d900
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -534,6 +534,7 @@ function DirectoryPreview({ model }: DirectoryPreviewProps) {
const [selectedPath, setSelectedPath] = useState(""); const [selectedPath, setSelectedPath] = useState("");
const [refreshVersion, setRefreshVersion] = useAtom(model.refreshVersion); const [refreshVersion, setRefreshVersion] = useAtom(model.refreshVersion);
const conn = useAtomValue(model.connection); const conn = useAtomValue(model.connection);
const blockData = useAtomValue(model.blockAtom);
useEffect(() => { useEffect(() => {
model.refreshCallback = () => { model.refreshCallback = () => {
@ -593,7 +594,12 @@ function DirectoryPreview({ model }: DirectoryPreviewProps) {
setSearchText((current) => current.slice(0, -1)); setSearchText((current) => current.slice(0, -1));
return true; return true;
} }
if (checkKeyPressed(waveEvent, "Space") && searchText == "" && PLATFORM == "darwin") { if (
checkKeyPressed(waveEvent, "Space") &&
searchText == "" &&
PLATFORM == "darwin" &&
!blockData?.meta?.connection
) {
getApi().onQuicklook(selectedPath); getApi().onQuicklook(selectedPath);
console.log(selectedPath); console.log(selectedPath);
return true; return true;