Fix or disable several swiftlint warnings

This commit is contained in:
QuentinArguillere 2024-01-09 16:50:40 +01:00
parent d97f07942f
commit 1ddf2602b9
6 changed files with 21 additions and 4 deletions

View file

@ -18,6 +18,7 @@
*/
// swiftlint:disable type_body_length
// swiftlint:disable line_length
import SwiftUI
import CallKit
import AVFAudio
@ -131,7 +132,7 @@ struct CallView: View {
.foregroundStyle(.white)
.frame(width: 32, height: 32)
.onAppear(perform: getAudioRouteImage)
.onReceive(pub) { (output) in
.onReceive(pub) { _ in
self.getAudioRouteImage()
}
@ -836,3 +837,4 @@ struct CallView: View {
CallView(callViewModel: CallViewModel())
}
// swiftlint:enable type_body_length
// swiftlint:enable line_length

View file

@ -98,5 +98,8 @@ struct ContactsListFragment: View {
}
#Preview {
ContactsListFragment(contactViewModel: ContactViewModel(), contactsListViewModel: ContactsListViewModel(), showingSheet: .constant(false), startCallFunc: {_ in })
ContactsListFragment(contactViewModel: ContactViewModel()
, contactsListViewModel: ContactsListViewModel()
, showingSheet: .constant(false)
, startCallFunc: {_ in })
}

View file

@ -44,7 +44,8 @@ class ContactAvatarModel: ObservableObject {
if friend!.consolidatedPresence == .Online || friend!.consolidatedPresence == .Busy {
if friend!.consolidatedPresence == .Online || friend!.presenceModel!.latestActivityTimestamp != -1 {
self.lastPresenceInfo = friend!.consolidatedPresence == .Online ? "Online" : getCallTime(startDate: friend!.presenceModel!.latestActivityTimestamp)
self.lastPresenceInfo = (friend!.consolidatedPresence == .Online) ?
"Online" : getCallTime(startDate: friend!.presenceModel!.latestActivityTimestamp)
} else {
self.lastPresenceInfo = "Away"
}
@ -68,7 +69,8 @@ class ContactAvatarModel: ObservableObject {
self.presenceStatus = cbValue.consolidatedPresence
if cbValue.consolidatedPresence == .Online || cbValue.consolidatedPresence == .Busy {
if cbValue.consolidatedPresence == .Online || cbValue.presenceModel!.latestActivityTimestamp != -1 {
self.lastPresenceInfo = cbValue.consolidatedPresence == .Online ? "Online" : self.getCallTime(startDate: cbValue.presenceModel!.latestActivityTimestamp)
self.lastPresenceInfo = cbValue.consolidatedPresence == .Online ?
"Online" : self.getCallTime(startDate: cbValue.presenceModel!.latestActivityTimestamp)
} else {
self.lastPresenceInfo = "Away"
}

View file

@ -18,6 +18,7 @@
*/
// swiftlint:disable type_body_length
// swiftlint:disable line_length
import SwiftUI
import linphonesw
@ -731,3 +732,4 @@ struct ContentView: View {
)
}
// swiftlint:enable type_body_length
// swiftlint:enable line_length

View file

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// swiftlint:disable line_length
import SwiftUI
import UniformTypeIdentifiers
@ -549,3 +551,5 @@ struct HistoryContactFragment: View {
indexPage: .constant(1)
)
}
// swiftlint:enable line_length

View file

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// swiftlint:disable line_length
import SwiftUI
import linphonesw
@ -217,3 +219,5 @@ struct HistoryListFragment: View {
#Preview {
HistoryListFragment(historyListViewModel: HistoryListViewModel(), historyViewModel: HistoryViewModel(), showingSheet: .constant(false))
}
// swiftlint:enable line_length