From 082f5b27139005cd8da95e3d024133ac86dca91d Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Thu, 6 Mar 2025 16:46:32 +1100 Subject: [PATCH] fix issues after merging --- .../ConversationVC+Interaction.swift | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 3d212ebb0..27c203372 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -2006,22 +2006,28 @@ extension ConversationVC: UIPasteboard.general.setData(data, forPasteboardType: type.identifier) } - self.viewModel.showToast( - text: "copied".localized(), - backgroundColor: .toast_background, - insect: Values.largeSpacing + (self.inputAccessoryView?.frame.height ?? 0) - ) + + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(Int(ContextMenuVC.dismissDurationPartOne * 1000))) { [weak self] in + self?.viewModel.showToast( + text: "copied".localized(), + backgroundColor: .toast_background, + inset: Values.largeSpacing + (self?.inputAccessoryView?.frame.height ?? 0) + ) + } } func copySessionID(_ cellViewModel: MessageViewModel) { guard cellViewModel.variant == .standardIncoming else { return } UIPasteboard.general.string = cellViewModel.authorId - self.viewModel.showToast( - text: "copied".localized(), - backgroundColor: .toast_background, - insect: Values.largeSpacing + (self.inputAccessoryView?.frame.height ?? 0) - ) + + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(Int(ContextMenuVC.dismissDurationPartOne * 1000))) { [weak self] in + self?.viewModel.showToast( + text: "copied".localized(), + backgroundColor: .toast_background, + inset: Values.largeSpacing + (self?.inputAccessoryView?.frame.height ?? 0) + ) + } } func delete(_ cellViewModel: MessageViewModel) { @@ -2175,11 +2181,14 @@ extension ConversationVC: } self?.sendDataExtraction(kind: .mediaSaved(timestamp: UInt64(cellViewModel.timestampMs))) - self?.viewModel.showToast( - text: "saved".localized(), - backgroundColor: .toast_background, - insect: Values.largeSpacing + (self?.inputAccessoryView?.frame.height ?? 0) - ) + + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(Int(ContextMenuVC.dismissDurationPartOne * 1000))) { [weak self] in + self?.viewModel.showToast( + text: "saved".localized(), + backgroundColor: .toast_background, + inset: Values.largeSpacing + (self?.inputAccessoryView?.frame.height ?? 0) + ) + } } }