Periphery cleanup (#5893)

This commit is contained in:
Mauro
2026-07-20 11:16:11 +02:00
committed by GitHub
parent 175aca596e
commit 9093631f8b
275 changed files with 381 additions and 2268 deletions
@@ -35,7 +35,6 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
}
private struct WysiwygLinkData {
let action: LinkAction
let range: NSRange
var url: String
var text: String
@@ -65,8 +64,6 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
attributedStringBuilder = AttributedStringBuilder(cacheKey: "Composer", mentionBuilder: mentionBuilder)
super.init(initialViewState: ComposerToolbarViewState(wysiwygViewModel: wysiwygViewModel,
audioPlayerState: .init(id: .recorderPreview, title: L10n.commonVoiceMessage, duration: 0),
audioRecorderState: .init(),
isRoomEncrypted: roomProxy.infoPublisher.value.isEncrypted,
isLocationSharingEnabled: appSettings.mapTilerSettings.publisher.value.isEnabled,
bindings: .init()),
@@ -580,10 +577,8 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
switch mode {
case .default:
break
case .recordVoiceMessage(let audioRecorderState):
state.audioRecorderState = audioRecorderState
case .previewVoiceMessage(let audioPlayerState, _, _):
state.audioPlayerState = audioPlayerState
case .recordVoiceMessage, .previewVoiceMessage:
break
case .edit, .reply:
// Focus composer when switching to reply/edit
state.bindings.composerFocused = true
@@ -645,8 +640,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
private func createLinkAlert() {
let linkAction = wysiwygViewModel.getLinkAction()
currentLinkData = WysiwygLinkData(action: linkAction,
range: wysiwygViewModel.attributedContent.selection,
currentLinkData = WysiwygLinkData(range: wysiwygViewModel.attributedContent.selection,
url: linkAction.url ?? "",
text: "")