fix: scheduled task cleanup error - upgrade to v1.2.1 (#816)

fix: scheduled task cleanup error "e.get is not a function"

- Use optional chaining in i18n.getMessagesbyContext to safely access Context methods
- Update version to v1.2.1

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Dream Hunter
2026-01-19 20:05:06 +08:00
committed by GitHub
parent 2cce3df213
commit 2318e0f7e2
9 changed files with 2485 additions and 2514 deletions

View File

@@ -17,7 +17,7 @@ export default {
getMessagesbyContext: (
c: Context<HonoCustomType>
): LocaleMessages => {
const locale = c.get("lang") || c.env.DEFAULT_LANG;
const locale = c?.get?.("lang") || c.env?.DEFAULT_LANG;
// multi-language support
if (locale === "en") return en;
if (locale === "zh") return zh;