File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,25 @@ function hideRoutingToast() {
1010
1111// Undefined is used as the default value instead of null to comply with the route handlers, which also use undefined as the default value.
1212function getListPathParam ( ) {
13- return new URLSearchParams ( window . location . next || window . location . search ) . get ( 'list_path' ) ?? undefined ;
13+ return getParam ( 'list_path' ) ;
1414}
1515
1616function getMessageUidParam ( ) {
17- return new URLSearchParams ( window . location . next || window . location . search ) . get ( 'uid' ) ?? undefined ;
17+ return getParam ( 'uid' ) ;
1818}
1919
2020function getPageNameParam ( ) {
21- return new URLSearchParams ( window . location . next || window . location . search ) . get ( 'page' ) ?? undefined ;
21+ return getParam ( 'page' ) ;
2222}
2323
2424function getParam ( param ) {
25- return new URLSearchParams ( window . location . next || window . location . search ) . get ( param ) ?? undefined ;
25+ let urlOrFragment = window . location . next || window . location . search ;
26+ let sp = null ;
27+ if ( urlOrFragment . match ( / ^ h t t p s ? : \/ \/ / ) ) {
28+ let url = new URL ( urlOrFragment ) ;
29+ sp = url . searchParams ;
30+ } else {
31+ sp = new URLSearchParams ( urlOrFragment ) ;
32+ }
33+ return sp . get ( param ) ?? undefined ;
2634}
You can’t perform that action at this time.
0 commit comments