Skip to content

Commit

Permalink
fix: Remove unreachable code
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jan 29, 2024
1 parent 3f8327e commit d55dbc6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,17 @@ export const imagePath = (app: string, file: string) => {
*/
export const generateFilePath = (app: string, type: string, file: string) => {
const isCore = window?.OC?.coreApps?.indexOf(app) !== -1
const isPHP = file.slice(-3) === 'php'
let link = getRootUrl()
if (file.substring(file.length - 3) === 'php' && !isCore) {
if (isPHP && !isCore) {
link += `/index.php/apps/${app}`
if (type) {
link += `/${encodeURI(type)}`
}
if (file !== 'index.php') {
link += `/${file}`
}
} else if (file.substring(file.length - 3) !== 'php' && !isCore) {
} else if (!isPHP && !isCore) {
link = getAppRootUrl(app)
if (type) {
link += '/' + type + '/'
Expand All @@ -187,9 +188,6 @@ export const generateFilePath = (app: string, type: string, file: string) => {
} else {
link += '/'
}
if (!isCore) {
link += 'apps/'
}
if (app !== '') {
app += '/'
link += app
Expand Down

0 comments on commit d55dbc6

Please sign in to comment.