Gifts: Remove button in channels (#5318)

This commit is contained in:
zubiden 2024-12-20 11:37:12 +01:00 committed by Alexander Zinchuk
parent 9c67832496
commit 8bcfcd0c88

View File

@ -64,5 +64,6 @@ export function selectCanGift<T extends GlobalState>(global: T, userId: string)
const bot = selectBot(global, userId);
const user = selectUser(global, userId);
return !selectIsPremiumPurchaseBlocked(global) && !bot && !user?.isSelf && userId !== SERVICE_NOTIFICATIONS_USER_ID;
return !selectIsPremiumPurchaseBlocked(global) && user && !bot
&& !user.isSelf && userId !== SERVICE_NOTIFICATIONS_USER_ID;
}