Skip to content

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

fix upload dialog after KanBan upload

sytolka4b1d2d9db55
diff --git a/app/components/dialogs/FileUploadDialog.tsx b/app/components/dialogs/FileUploadDialog.tsx
index 33ad9d12d..b186e90af 100644
--- a/app/components/dialogs/FileUploadDialog.tsx
+++ b/app/components/dialogs/FileUploadDialog.tsx
@@ -30,16 +30,22 @@ import Box from '@mui/material/Box';
import { LinearProgress, Grid, Tooltip } from '@mui/material';
import WarningIcon from '@mui/icons-material/Warning';
import PlatformIO from '-/services/platform-facade';
-import { actions as AppActions, getProgress } from '-/reducers/app';
+import {
+ actions as AppActions,
+ getCurrentDirectoryPerspective,
+ getProgress
+} from '-/reducers/app';
import { extractFileName } from '@tagspaces/tagspaces-platforms/paths';
import i18n from '-/services/i18n';
import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
+import { PerspectiveIDs } from '-/perspectives';
interface Props {
open: boolean;
progress?: Array<any>;
onClose: () => void;
clearUploadDialog: () => void;
+ currentDirectoryPerspective: string;
}
function FileUploadDialog(props: Props) {
@@ -152,7 +158,12 @@ function FileUploadDialog(props: Props) {
{!haveProgress && (
<Button
data-tid="uploadCloseDialog"
- onClick={props.clearUploadDialog}
+ onClick={() => {
+ onClose();
+ if (props.currentDirectoryPerspective === PerspectiveIDs.GRID) {
+ props.clearUploadDialog();
+ }
+ }}
color="primary"
>
{i18n.t('core:closeAndClear')}
@@ -181,7 +192,8 @@ function FileUploadDialog(props: Props) {
function mapStateToProps(state) {
return {
- progress: getProgress(state)
+ progress: getProgress(state),
+ currentDirectoryPerspective: getCurrentDirectoryPerspective(state)
};
}
diff --git a/app/services/utils-io.ts b/app/services/utils-io.ts
index a01ab24cb..cbff955e5 100644
--- a/app/services/utils-io.ts
+++ b/app/services/utils-io.ts
@@ -1295,6 +1295,9 @@ export function getThumbPath(
return undefined;
}
if (PlatformIO.haveObjectStoreSupport() || PlatformIO.haveWebDavSupport()) {
+ if (isSignedURL(thumbPath)) {
+ return thumbPath;
+ }
return PlatformIO.getURLforPath(thumbPath);
}
return (
@@ -1303,6 +1306,14 @@ export function getThumbPath(
);
}
+function isSignedURL(signedUrl) {
+ try {
+ // const query = url.parse(signedUrl, true).query;
+ return signedUrl.indexOf('Signature=') !== -1;
+ } catch (ex) {}
+ return false;
+}
+
export function getFolderBgndPath(
path: string,
lastBackgroundImageChange: number