From 00abf79417b44360355e69b7d359a441ae1ea765 Mon Sep 17 00:00:00 2001 From: Dream Hunter Date: Wed, 29 May 2024 12:08:56 +0800 Subject: [PATCH] fix: cannot delete addres when not bind KV (#284) --- CHANGELOG.md | 3 ++- frontend/package.json | 2 +- worker/src/constants.ts | 2 +- worker/src/telegram_api/common.ts | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c966f7f..c8923306 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # CHANGE LOG -## main branch +## v0.4.6 - worker 配置文件添加 `TITLE = "Custom Title"`, 可自定义网站标题 +- 修复 KV 未绑定无法删除地址的问题 ## v0.4.5 diff --git a/frontend/package.json b/frontend/package.json index 709cb475..2f06cad9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "cloudflare_temp_email", - "version": "0.4.5", + "version": "0.4.6", "private": true, "type": "module", "scripts": { diff --git a/worker/src/constants.ts b/worker/src/constants.ts index 572d70d0..aec1b16a 100644 --- a/worker/src/constants.ts +++ b/worker/src/constants.ts @@ -1,5 +1,5 @@ export const CONSTANTS = { - VERSION: 'v0.4.5', + VERSION: 'v0.4.6', // DB settings ADDRESS_BLOCK_LIST_KEY: 'address_block_list', diff --git a/worker/src/telegram_api/common.ts b/worker/src/telegram_api/common.ts index e541684a..a2a6aca0 100644 --- a/worker/src/telegram_api/common.ts +++ b/worker/src/telegram_api/common.ts @@ -102,6 +102,7 @@ export const unbindTelegramAddress = async ( export const unbindTelegramByAddress = async ( c: Context, address: string ): Promise => { + if (!c.env.KV) return true; const userId = await c.env.KV.get(`${CONSTANTS.TG_KV_PREFIX}:${address}`) if (userId) { return await unbindTelegramAddress(c, userId, address);