Skip to content
Snippets Groups Projects
Commit 99a5ec18 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Add success toast to block

parent 8f65cafb
No related branches found
No related tags found
3 merge requests!71Releasing v1.1.5 (214),!69Implemented filtering for banned/blocked users and reporting,!67v1.1.5 b(203)
......@@ -8,6 +8,7 @@ import XXModels
import Foundation
import Integration
import Permissions
import ToastFeature
import DifferenceKit
import DependencyInjection
......@@ -26,6 +27,7 @@ final class SingleChatViewModel {
@Dependency private var logger: XXLogger
@Dependency private var session: SessionType
@Dependency private var permissions: PermissionHandling
@Dependency private var toastController: ToastController
var contact: Contact { contactSubject.value }
private var stagedReply: Reply?
......@@ -226,6 +228,12 @@ final class SingleChatViewModel {
var contact = contact
contact.isBlocked = true
_ = try? session.dbManager.saveContact(contact)
let name = (contact.nickname ?? contact.username) ?? ""
toastController.enqueueToast(model: .init(
title: "Your report has been sent and \(name) is now blocked.",
leftImage: Asset.requestSentToaster.image
))
}
func showRoundFrom(_ roundURL: String?) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment