修复礼包领取弹窗重复显示
This commit is contained in:
@@ -94,6 +94,8 @@ class GameBetBroadcastService
|
||||
toastMessage: "<b>{$username}</b> 抢到 <b>{$formattedAmount}</b> {$typeLabel}礼包",
|
||||
toastIcon: '🧧',
|
||||
toastColor: $toastColor,
|
||||
toastActorUsername: $username,
|
||||
skipToastForActor: true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -109,7 +111,23 @@ class GameBetBroadcastService
|
||||
string $toastIcon,
|
||||
string $toastColor,
|
||||
string $action = '',
|
||||
?string $toastActorUsername = null,
|
||||
bool $skipToastForActor = false,
|
||||
): void {
|
||||
$toastNotification = [
|
||||
'title' => $toastTitle,
|
||||
'message' => $toastMessage,
|
||||
'icon' => $toastIcon,
|
||||
'color' => $toastColor,
|
||||
'duration' => 8000,
|
||||
];
|
||||
|
||||
if ($toastActorUsername !== null) {
|
||||
// 记录触发人用于前端去重,避免本人同时看到本地到账提示和公屏领取提示。
|
||||
$toastNotification['actor_username'] = $toastActorUsername;
|
||||
$toastNotification['skip_for_actor'] = $skipToastForActor;
|
||||
}
|
||||
|
||||
$message = [
|
||||
'id' => $this->chatState->nextMessageId($roomId),
|
||||
'room_id' => $roomId,
|
||||
@@ -120,13 +138,7 @@ class GameBetBroadcastService
|
||||
'font_color' => $fontColor,
|
||||
'action' => $action,
|
||||
'sent_at' => now()->toDateTimeString(),
|
||||
'toast_notification' => [
|
||||
'title' => $toastTitle,
|
||||
'message' => $toastMessage,
|
||||
'icon' => $toastIcon,
|
||||
'color' => $toastColor,
|
||||
'duration' => 8000,
|
||||
],
|
||||
'toast_notification' => $toastNotification,
|
||||
];
|
||||
|
||||
// 下注通知必须进房间 Presence 频道,确保当前房间所有在线人员都能看到右下角提示。
|
||||
|
||||
Reference in New Issue
Block a user