Skip to content

Commit b5cb613

Browse files
committed
Update api-link-parser.js
1 parent b8085a5 commit b5cb613

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

api-link-parser.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,18 @@ function decodeLink(url) {
8888
'&file=' + linkData.file;
8989

9090
linkData.redirectText = 'Open ' + linkData.user + '/' + linkData.repo + ' with Codeit';
91-
91+
9292
} // else, show the file's code
9393

94-
} else { // if linking to directory
94+
} else if (isEmbed) { // if linking to directory
95+
// and link is embed
9596

96-
// if link is embed
97-
if (isEmbed) {
98-
99-
// show directory link
100-
linkData.redirect = baseURL + '/full?dir=' +
101-
linkData.user + ',' + linkData.repo +
102-
',' + linkData.contents;
103-
104-
linkData.redirectText = 'Open ' + linkData.user + '/' + linkData.repo + ' with Codeit';
97+
// show directory link
98+
linkData.redirect = baseURL + '/full?dir=' +
99+
linkData.user + ',' + linkData.repo +
100+
',' + linkData.contents;
105101

106-
} // else, show directory
102+
linkData.redirectText = 'Open ' + linkData.user + '/' + linkData.repo + ' with Codeit';
107103

108104
}
109105

0 commit comments

Comments
 (0)