Skip to content

Commit e1724b2

Browse files
committed
save webhook if was empty
1 parent fd96972 commit e1724b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/redis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export const setConfig = async (phone: string, value: any) => {
291291
const currentWebhooks: Webhook[] = currentConfig && currentConfig.webhooks || []
292292
const newWebhooks: Webhook[] = value && value.webhooks || []
293293
const updatedWebooks: Webhook[] = []
294-
const baseWebhook = value.overrideWebhooks ? newWebhooks : currentWebhooks
294+
const baseWebhook = value.overrideWebhooks || currentWebhooks.length == 0 ? newWebhooks : currentWebhooks
295295
const searchWebhooks = value.overrideWebhooks ? currentWebhooks : newWebhooks
296296
baseWebhook.forEach(n => {
297297
const c = searchWebhooks.find((c) => c.id === n.id)

0 commit comments

Comments
 (0)