mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-02-20 07:37:26 -05:00
* Fix macOS PDF rendering - Fix app crashing due to PDF rendering receiving empty URLs - Attempt fix PDF rendering empty PDFs due to it not supporting range requests * Fix dumb change from `data` to `src` in `<object>` - Fix QuickPreview not closing with space bar - Fix double-click simultaneously renaming and opening file - Minor improvements to QuickPreview header - Fix Button inside Button react error in QuickPreview - Don't render thumb without a valid source * ExternalObject events must not influence the link state - More macOS PDF range changes * Use `<iframe>` instead of `<embed>` or `<object>` to load pdf in macOS - Revert removing range support for macOS pdf type - Rename `ExternalObject` to `PDFViewer` - Fix `AddLocationDialog` sometimes requiring multiple confimations on first load * `Accept-Ranges: none` Header response as it breaks linux video playback - Extract location id from from `ExplorerItemData`, to allow rendering original versions on `Overview` * Format * cargo fmt
17 lines
524 B
TypeScript
17 lines
524 B
TypeScript
import { useKey } from 'rooks';
|
|
import { ExplorerItem } from '@sd/client';
|
|
import { dialogManager } from '@sd/ui';
|
|
import DeleteDialog from '~/app/$libraryId/Explorer/File/DeleteDialog';
|
|
|
|
export const useKeyDeleteFile = (selectedItem: ExplorerItem | null, location_id: number | null) => {
|
|
return useKey('Delete', (e) => {
|
|
e.preventDefault();
|
|
|
|
if (!selectedItem || !location_id) return;
|
|
|
|
dialogManager.create((dp) => (
|
|
<DeleteDialog {...dp} location_id={location_id} path_id={selectedItem.item.id} />
|
|
));
|
|
});
|
|
};
|