Skip to content

TagSpaces is an offline, open source, document manager with tagging support

disable drag outside of app for S3 location

sytolk10982c0a46d1
diff --git a/src/renderer/perspectives/common/CellView.tsx b/src/renderer/perspectives/common/CellView.tsx
index 9fc947e7d..0b628194a 100644
--- a/src/renderer/perspectives/common/CellView.tsx
+++ b/src/renderer/perspectives/common/CellView.tsx
@@ -296,27 +296,29 @@ function CellView(props: Props) {
if (fsEntry.isFile) {
return (
<div>
- {nativeDragModeEnabled && (
- <div
- style={{
- display: 'flex',
- }}
- draggable="true"
- onDragStart={(e) => {
- e.preventDefault();
- window.electronIO.ipcRenderer.startDrag(fsEntry.path);
- }}
- >
- <DragHandleIcon style={{ color: theme.palette.text.primary }} />
- <Typography
- color="textSecondary"
- variant="caption"
- style={{ alignSelf: 'center' }}
+ {nativeDragModeEnabled &&
+ AppConfig.isElectron &&
+ !currentLocation.haveObjectStoreSupport() && (
+ <div
+ style={{
+ display: 'flex',
+ }}
+ draggable="true"
+ onDragStart={(e) => {
+ e.preventDefault();
+ window.electronIO.ipcRenderer.startDrag(fsEntry.path);
+ }}
>
- {i18n.t('dragOutsideApp')}
- </Typography>
- </div>
- )}
+ <DragHandleIcon style={{ color: theme.palette.text.primary }} />
+ <Typography
+ color="textSecondary"
+ variant="caption"
+ style={{ alignSelf: 'center' }}
+ >
+ {i18n.t('dragOutsideApp')}
+ </Typography>
+ </div>
+ )}
<FileSourceDnd key={key}>
{cellContent(
diff --git a/src/renderer/perspectives/grid/components/MainToolbar.tsx b/src/renderer/perspectives/grid/components/MainToolbar.tsx
index 96c947b32..794e6491f 100644
--- a/src/renderer/perspectives/grid/components/MainToolbar.tsx
+++ b/src/renderer/perspectives/grid/components/MainToolbar.tsx
@@ -93,7 +93,7 @@ function MainToolbar(props: Props) {
useDirectoryContentContext();
const { selectedEntries } = useSelectedEntriesContext();
const keyBindings = useSelector(getKeyBindingObject);
- const dispatch: AppDispatch = useDispatch();
+ //const dispatch: AppDispatch = useDispatch();
const { currentLocation, readOnlyMode } = useCurrentLocationContext();
const { openDeleteMultipleEntriesDialog } =
useDeleteMultipleEntriesDialogContext();
@@ -288,7 +288,7 @@ function MainToolbar(props: Props) {
<ZoomComponent preview={false} />
<Divider flexItem orientation="vertical" sx={{ mx: 0.5, my: 1 }} />
</Box>
- {AppConfig.isElectron && (
+ {AppConfig.isElectron && !currentLocation.haveObjectStoreSupport() && (
<Tooltip title={t('core:dragMode')}>
<IconButton
data-tid={prefixDataTID + 'PerspectiveDragNative'}