|
|
@@ -34,12 +34,6 @@ class LNRoomGiftPanel: LNPopupView {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-extension LNRoomGiftPanel: LNRoomGiftHeaderViewDelegate {
|
|
|
- func onRoomGiftHeaderViewSelectionChanged(_ view: LNRoomGiftHeaderView) {
|
|
|
- checkSendEnable()
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
extension LNRoomGiftPanel: LNRoomGiftListViewDelegate {
|
|
|
func onRoomGiftListView(_ view: LNRoomGiftListView, didSelect index: Int) {
|
|
|
checkSendEnable()
|
|
|
@@ -53,9 +47,11 @@ extension LNRoomGiftPanel: LNRoomGiftBottomViewDelegate {
|
|
|
}
|
|
|
|
|
|
func onRoomGiftBottomViewDidTapSend(_ view: LNRoomGiftBottomView) {
|
|
|
- guard !headerView.selection.isEmpty,
|
|
|
- let gift = listView.selectedGift
|
|
|
- else {
|
|
|
+ if headerView.selection.isEmpty {
|
|
|
+ showToast(.init(key: "A00391"))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ guard let gift = listView.selectedGift else {
|
|
|
return
|
|
|
}
|
|
|
roomSession?.sendGift(gift: gift, to: headerView.selection, count: bottomView.curCount) { _ in }
|
|
|
@@ -64,14 +60,13 @@ extension LNRoomGiftPanel: LNRoomGiftBottomViewDelegate {
|
|
|
|
|
|
extension LNRoomGiftPanel {
|
|
|
private func checkSendEnable() {
|
|
|
- bottomView.enable = !headerView.selection.isEmpty && listView.selectedGift != nil
|
|
|
+ bottomView.enable = listView.selectedGift != nil
|
|
|
}
|
|
|
|
|
|
private func setupViews() {
|
|
|
touchOutsideToCancel = true
|
|
|
container.backgroundColor = .fill_7
|
|
|
|
|
|
- headerView.delegate = self
|
|
|
container.addSubview(headerView)
|
|
|
headerView.snp.makeConstraints { make in
|
|
|
make.top.equalToSuperview().offset(12)
|