File tree 1 file changed +11
-11
lines changed
scaladoc-js/src/versions-dropdown
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,19 @@ class DropdownHandler:
40
40
41
41
window.sessionStorage.getItem(KEY ) match
42
42
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" =>
54
45
window.sessionStorage.setItem(KEY , UNDEFINED_VERSIONS )
55
46
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
+ }
56
56
case value => value match
57
57
case UNDEFINED_VERSIONS =>
58
58
disableButton()
You can’t perform that action at this time.
0 commit comments