mirror of https://github.com/status-im/codimd.git
Fix linting errors
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
This commit is contained in:
parent
8cd9ba2f82
commit
821295ecd3
|
@ -38,7 +38,7 @@ async function checkVersion (ctx) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let locals = ctx.locals ? ctx.locals : ctx.app.locals
|
const locals = ctx.locals ? ctx.locals : ctx.app.locals
|
||||||
|
|
||||||
locals.versionInfo.latest = data.latest
|
locals.versionInfo.latest = data.latest
|
||||||
locals.versionInfo.versionItem = data.latest ? null : data.versionItem
|
locals.versionInfo.versionItem = data.latest ? null : data.versionItem
|
||||||
|
@ -48,14 +48,10 @@ async function checkVersion (ctx) {
|
||||||
|
|
||||||
logger.warn(`Your CodiMD version is out of date! The latest version is ${version}. Please see what's new on ${link}.`)
|
logger.warn(`Your CodiMD version is out of date! The latest version is ${version}. Please see what's new on ${link}.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore and skip version check
|
// ignore and skip version check
|
||||||
logger.error('Version check failed.')
|
logger.error('Version check failed.')
|
||||||
logger.error(err)
|
logger.error(err)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +61,7 @@ exports.versionCheckMiddleware = function (req, res, next) {
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
logger.error(err)
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue