File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ export default {
103103 data () {
104104 return {
105105 url: this .$route .params .url ,
106- urlError: null ,
106+ urlError: this . checkUrl ( this . $route . params . url ) ,
107107 title: this .$route .params .title || ' ' ,
108108 temporaryParent: null ,
109109 displayFolderChooser: false ,
@@ -151,13 +151,7 @@ export default {
151151 this .$store .dispatch (actions .LOAD_TREE , this .id )
152152 },
153153 url () {
154- this .urlError = null
155- try {
156- // eslint-disable-next-line
157- new URL (this .url )
158- } catch (e) {
159- this .urlError = ' Invalid URL'
160- }
154+ this .urlError = this .checkUrl (this .url )
161155 },
162156 tree () {
163157 const parentFolder = this .tree .findFolder (this .$store .state .lastFolders [this .id ]) || this .tree .findFolder (this .tree .id )
@@ -189,6 +183,15 @@ export default {
189183 },
190184 onTriggerFolderChooser () {
191185 this .displayFolderChooser = true
186+ },
187+ checkUrl (url ) {
188+ try {
189+ // eslint-disable-next-line
190+ new URL (url)
191+ return null
192+ } catch (e) {
193+ return ' Invalid URL'
194+ }
192195 }
193196 }
194197}
You can’t perform that action at this time.
0 commit comments