mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 15:38:34 +08:00
fix: cannot delete addres when not bind KV (#284)
This commit is contained in:
+2
-1
@@ -1,9 +1,10 @@
|
|||||||
<!-- markdownlint-disable-file MD004 MD024 MD034 MD036 -->
|
<!-- markdownlint-disable-file MD004 MD024 MD034 MD036 -->
|
||||||
# CHANGE LOG
|
# CHANGE LOG
|
||||||
|
|
||||||
## main branch
|
## v0.4.6
|
||||||
|
|
||||||
- worker 配置文件添加 `TITLE = "Custom Title"`, 可自定义网站标题
|
- worker 配置文件添加 `TITLE = "Custom Title"`, 可自定义网站标题
|
||||||
|
- 修复 KV 未绑定无法删除地址的问题
|
||||||
|
|
||||||
## v0.4.5
|
## v0.4.5
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cloudflare_temp_email",
|
"name": "cloudflare_temp_email",
|
||||||
"version": "0.4.5",
|
"version": "0.4.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const CONSTANTS = {
|
export const CONSTANTS = {
|
||||||
VERSION: 'v0.4.5',
|
VERSION: 'v0.4.6',
|
||||||
|
|
||||||
// DB settings
|
// DB settings
|
||||||
ADDRESS_BLOCK_LIST_KEY: 'address_block_list',
|
ADDRESS_BLOCK_LIST_KEY: 'address_block_list',
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ export const unbindTelegramAddress = async (
|
|||||||
export const unbindTelegramByAddress = async (
|
export const unbindTelegramByAddress = async (
|
||||||
c: Context<HonoCustomType>, address: string
|
c: Context<HonoCustomType>, address: string
|
||||||
): Promise<boolean> => {
|
): Promise<boolean> => {
|
||||||
|
if (!c.env.KV) return true;
|
||||||
const userId = await c.env.KV.get<string>(`${CONSTANTS.TG_KV_PREFIX}:${address}`)
|
const userId = await c.env.KV.get<string>(`${CONSTANTS.TG_KV_PREFIX}:${address}`)
|
||||||
if (userId) {
|
if (userId) {
|
||||||
return await unbindTelegramAddress(c, userId, address);
|
return await unbindTelegramAddress(c, userId, address);
|
||||||
|
|||||||
Reference in New Issue
Block a user