Skip to content

Commit d55dbc6

Browse files
committed
fix: Remove unreachable code
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 3f8327e commit d55dbc6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,17 @@ export const imagePath = (app: string, file: string) => {
163163
*/
164164
export const generateFilePath = (app: string, type: string, file: string) => {
165165
const isCore = window?.OC?.coreApps?.indexOf(app) !== -1
166+
const isPHP = file.slice(-3) === 'php'
166167
let link = getRootUrl()
167-
if (file.substring(file.length - 3) === 'php' && !isCore) {
168+
if (isPHP && !isCore) {
168169
link += `/index.php/apps/${app}`
169170
if (type) {
170171
link += `/${encodeURI(type)}`
171172
}
172173
if (file !== 'index.php') {
173174
link += `/${file}`
174175
}
175-
} else if (file.substring(file.length - 3) !== 'php' && !isCore) {
176+
} else if (!isPHP && !isCore) {
176177
link = getAppRootUrl(app)
177178
if (type) {
178179
link += '/' + type + '/'
@@ -187,9 +188,6 @@ export const generateFilePath = (app: string, type: string, file: string) => {
187188
} else {
188189
link += '/'
189190
}
190-
if (!isCore) {
191-
link += 'apps/'
192-
}
193191
if (app !== '') {
194192
app += '/'
195193
link += app

0 commit comments

Comments
 (0)