fix: avoid animated room rps gift icons

This commit is contained in:
zhx 2026-06-16 14:15:35 +08:00
parent 29b580f0ce
commit cfe77431eb
2 changed files with 2 additions and 2 deletions

View File

@ -690,7 +690,7 @@ func roomRPSGiftIconURL(gift *walletv1.GiftConfig) string {
gift.GetResource().GetPreviewUrl(),
}
for _, candidate := range candidates {
if value := strings.TrimSpace(candidate); value != "" {
if value := strings.TrimSpace(candidate); value != "" && !roomRPSURLLooksAnimated(value) {
return value
}
}

View File

@ -12,7 +12,7 @@ import (
func TestUpdateConfigEnrichesStakeGiftsFromWalletCatalog(t *testing.T) {
catalog := newFakeGiftCatalog(map[string]*walletv1.GiftConfig{
"2001": roomRPSWalletGift("2001", "Rose", "https://cdn.example.test/rose.png", "", "https://cdn.example.test/rose.mp4", 100),
"2002": roomRPSWalletGift("2002", "Bell", "", "https://cdn.example.test/bell-preview.png", "https://cdn.example.test/bell.svga", 300),
"2002": roomRPSWalletGift("2002", "Bell", "https://cdn.example.test/bell.mp4", "https://cdn.example.test/bell-preview.png", "https://cdn.example.test/bell.svga", 300),
"2003": roomRPSWalletGift("2003", "Crown", "", "", "https://cdn.example.test/crown.svga", 500),
"2004": roomRPSWalletGift("2004", "Cup", "https://cdn.example.test/cup.png", "", "", 1000),
})