mirror of
https://github.com/Cola-Echo/Cola.git
synced 2026-06-06 03:35:50 +00:00
Add files via upload
This commit is contained in:
8
gift.js
8
gift.js
@@ -349,8 +349,8 @@ export function checkGiftDelivery(contact) {
|
||||
const currentCount = contact.chatHistory?.length || 0;
|
||||
|
||||
for (const gift of contact.pendingGifts) {
|
||||
// 如果正在使用中,跳过
|
||||
if (gift.isUsing) continue;
|
||||
// 如果正在使用中或已完成,跳过
|
||||
if (gift.isUsing || gift.completed) continue;
|
||||
|
||||
// 首次送达检测
|
||||
if (!gift.isDelivered && currentCount >= gift.startMessageCount + 25) {
|
||||
@@ -415,6 +415,10 @@ export function showGiftArrivalModal(gift, contact) {
|
||||
yesBtn.removeEventListener('click', handleYes);
|
||||
noBtn.removeEventListener('click', handleNo);
|
||||
|
||||
// 标记礼物为已完成,防止重复触发弹窗
|
||||
gift.completed = true;
|
||||
requestSave();
|
||||
|
||||
// 打开玩具控制界面
|
||||
const { showToyControlPage } = await import('./toy-control.js');
|
||||
showToyControlPage(gift, contact, currentChatIndex);
|
||||
|
||||
Reference in New Issue
Block a user