File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,10 @@ import { isUrlOnRealm } from './url';
2828// like the web app's parse_narrow in static/js/hash_util.js.
2929// TODO(#3757): Use @zulip/shared for that parsing.
3030const getHashSegmentsFromNarrowLink = ( url : string , realm : URL ) => {
31- const result = new URL ( url , realm ) . hash
31+ // TODO: Get this from caller
32+ const parsedUrl = new URL ( url , realm ) ;
33+
34+ const result = parsedUrl . hash
3235 . split ( '/' )
3336 // Remove the first item, "#narrow".
3437 . slice ( 1 ) ;
@@ -66,7 +69,10 @@ type LinkType = 'non-narrow' | 'home' | 'pm' | 'topic' | 'stream' | 'special';
6669// TODO: Work out what this does, write a jsdoc for its interface, and
6770// reimplement using URL object (not just for the realm)
6871export const getLinkType = ( url : string , realm : URL ) : LinkType => {
69- if ( ! isNarrowLink ( new URL ( url , realm ) , realm ) ) {
72+ // TODO: Get this from caller
73+ const parsedUrl = new URL ( url , realm ) ;
74+
75+ if ( ! isNarrowLink ( parsedUrl , realm ) ) {
7076 return 'non-narrow' ;
7177 }
7278
You can’t perform that action at this time.
0 commit comments