|
@@ -22,7 +22,7 @@ export default function FileTreeImportFromUrl() {
|
|
|
// set the name when the URL changes
|
|
// set the name when the URL changes
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (url) {
|
|
if (url) {
|
|
|
- const matches = url.match(/^https?:\/\/.+\/([^/]+\.(\w+))$/)
|
|
|
|
|
|
|
+ const matches = url.match(/^\s*https?:\/\/.+\/([^/]+\.(\w+))\s*$/)
|
|
|
setName(matches ? matches[1] : '')
|
|
setName(matches ? matches[1] : '')
|
|
|
}
|
|
}
|
|
|
}, [setName, url])
|
|
}, [setName, url])
|
|
@@ -39,7 +39,7 @@ export default function FileTreeImportFromUrl() {
|
|
|
finishCreatingLinkedFile({
|
|
finishCreatingLinkedFile({
|
|
|
name,
|
|
name,
|
|
|
provider: 'url',
|
|
provider: 'url',
|
|
|
- data: { url },
|
|
|
|
|
|
|
+ data: { url: url.trim() },
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|