mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2022 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -27,7 +27,7 @@ struct PlaceholderAvatarViewModel {
|
||||
|
||||
/// Get the first character of the display name capitalized or else a space character.
|
||||
var firstCharacterCapitalized: Character {
|
||||
return displayName?.capitalized.first ?? " "
|
||||
displayName?.capitalized.first ?? " "
|
||||
}
|
||||
|
||||
/// Provides the same color each time for a specified matrixId
|
||||
@@ -39,7 +39,7 @@ struct PlaceholderAvatarViewModel {
|
||||
var stableColorIndex: Int {
|
||||
// Sum all characters
|
||||
let sum = matrixItemId.utf8
|
||||
.map({ UInt($0) })
|
||||
.map { UInt($0) }
|
||||
.reduce(0, +)
|
||||
// modulo the color count
|
||||
return Int(sum) % colorCount
|
||||
|
||||
Reference in New Issue
Block a user