Skip to content

Commit 821295e

Browse files
committed
Fix linting errors
Signed-off-by: Yukai Huang <[email protected]>
1 parent 8cd9ba2 commit 821295e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/web/middleware/checkVersion.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function checkVersion (ctx) {
3838
return
3939
}
4040

41-
let locals = ctx.locals ? ctx.locals : ctx.app.locals
41+
const locals = ctx.locals ? ctx.locals : ctx.app.locals
4242

4343
locals.versionInfo.latest = data.latest
4444
locals.versionInfo.versionItem = data.latest ? null : data.versionItem
@@ -48,14 +48,10 @@ async function checkVersion (ctx) {
4848

4949
logger.warn(`Your CodiMD version is out of date! The latest version is ${version}. Please see what's new on ${link}.`)
5050
}
51-
52-
return
5351
} catch (err) {
5452
// ignore and skip version check
5553
logger.error('Version check failed.')
5654
logger.error(err)
57-
58-
return
5955
}
6056
}
6157

@@ -65,6 +61,7 @@ exports.versionCheckMiddleware = function (req, res, next) {
6561
next()
6662
})
6763
.catch((err) => {
64+
logger.error(err)
6865
next()
6966
})
7067
}

0 commit comments

Comments
 (0)