File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
scaladoc-js/src/versions-dropdown Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,19 @@ class DropdownHandler:
4040
4141 window.sessionStorage.getItem(KEY ) match
4242 case null => // If no key, returns null
43- try
44- getURLContent(Globals .versionsDictionaryUrl).onComplete {
45- case Success (json : String ) =>
46- window.sessionStorage.setItem(KEY , json)
47- addVersionsList(json)
48- case Failure (_) =>
49- window.sessionStorage.setItem(KEY , UNDEFINED_VERSIONS )
50- disableButton()
51- }
52- catch // Globals.versionDictionaruUrl is undefined
53- case e =>
43+ js.typeOf(Globals .versionsDictionaryUrl) match
44+ case " undefined" =>
5445 window.sessionStorage.setItem(KEY , UNDEFINED_VERSIONS )
5546 disableButton()
47+ case _ =>
48+ getURLContent(Globals .versionsDictionaryUrl).onComplete {
49+ case Success (json : String ) =>
50+ window.sessionStorage.setItem(KEY , json)
51+ addVersionsList(json)
52+ case Failure (_) =>
53+ window.sessionStorage.setItem(KEY , UNDEFINED_VERSIONS )
54+ disableButton()
55+ }
5656 case value => value match
5757 case UNDEFINED_VERSIONS =>
5858 disableButton()
You can’t perform that action at this time.
0 commit comments