This commit is contained in:
Jan Prochazka
2020-12-05 16:57:25 +01:00
parent 10dc7343ae
commit ac7816fc4b

View File

@@ -179,7 +179,7 @@ function ElectronFilesInput() {
); );
} }
function extractUrlName(url) { function extractUrlName(url, values) {
const match = url.match(/\/([^/]+)($|\?)/); const match = url.match(/\/([^/]+)($|\?)/);
if (match) { if (match) {
const res = match[1]; const res = match[1];
@@ -188,7 +188,7 @@ function extractUrlName(url) {
} }
return res; return res;
} }
return 'url'; return `url${values && values.sourceList ? values.sourceList.length + 1 : '1'}`;
} }
function FilesInput({ setPreviewSource = undefined }) { function FilesInput({ setPreviewSource = undefined }) {
@@ -203,7 +203,7 @@ function FilesInput({ setPreviewSource = undefined }) {
[ [
{ {
fileName: url, fileName: url,
shortName: extractUrlName(url), shortName: extractUrlName(url, values),
isDownload: true, isDownload: true,
}, },
], ],
@@ -399,7 +399,7 @@ function SourceName({ name }) {
<div>{name}</div> <div>{name}</div>
<SourceNameButtons> <SourceNameButtons>
{obj && !!obj.isDownload && ( {obj && !!obj.isDownload && (
<IconButtonWrapper onClick={handleChangeUrl} theme={theme}> <IconButtonWrapper onClick={handleChangeUrl} theme={theme} title={obj && obj.fileName}>
<FontIcon icon="icon web" /> <FontIcon icon="icon web" />
</IconButtonWrapper> </IconButtonWrapper>
)} )}