@topconsultnpm/sdkui-react 6.20.0-dev2.15 → 6.20.0-dev2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,18 +9,16 @@ import { isXMLFileExt } from '../helper/dcmtsHelper';
|
|
|
9
9
|
import { ShowConfirm } from '../components/base/TMConfirm';
|
|
10
10
|
let abortController = new AbortController();
|
|
11
11
|
const downloadCountMap = new Map();
|
|
12
|
-
const compoundExts = ['.p7m', '.p7s', '.p7c', '.p7b'];
|
|
13
12
|
const getDownloadFileName = (fileName) => {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
13
|
+
const firstDot = fileName.indexOf('.');
|
|
14
|
+
const lastDot = fileName.lastIndexOf('.');
|
|
15
|
+
if (firstDot === -1 || firstDot === lastDot)
|
|
17
16
|
return fileName;
|
|
18
17
|
const count = downloadCountMap.get(fileName) ?? 0;
|
|
19
18
|
downloadCountMap.set(fileName, count + 1);
|
|
20
19
|
if (count === 0)
|
|
21
20
|
return fileName;
|
|
22
|
-
|
|
23
|
-
return `${fileName.slice(0, dotIndex)}(${count})${fileName.slice(dotIndex)}`;
|
|
21
|
+
return `${fileName.slice(0, firstDot)}(${count})${fileName.slice(firstDot)}`;
|
|
24
22
|
};
|
|
25
23
|
export function useDcmtOperations() {
|
|
26
24
|
const [showWaitPanel, setShowWaitPanel] = useState(false);
|