1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-01-31 17:45:17 +01:00

Fix warnings

This commit is contained in:
Nathan Mattes 2024-01-05 12:59:59 +01:00
parent 22d0b45be7
commit 120b9e18b1
5 changed files with 5 additions and 6 deletions

View File

@ -14,7 +14,7 @@ extension Mastodon.Entity.Account {
let isAnimated = !UserDefaults.shared.preferredStaticEmoji
var dict = MastodonContent.Emojis()
for emoji in emojis ?? [] {
for emoji in emojis {
dict[emoji.shortcode] = isAnimated ? emoji.url : emoji.staticURL
}
return dict

View File

@ -10,7 +10,6 @@ import Foundation
import UIKit
import Combine
import MastodonSDK
import MastodonCore
final public class FeedFetchedResultsController {

View File

@ -314,7 +314,7 @@ extension ComposeContentViewModel {
self.avatarURL = account.avatarImageURL()
do {
let content = MastodonContent(content: account.displayNameWithFallback, emojis: (account.emojis ?? []).asDictionary)
let content = MastodonContent(content: account.displayNameWithFallback, emojis: account.emojis.asDictionary)
let metaContent = try MastodonMetaContent.convert(document: content)
self.name = metaContent
} catch {

View File

@ -20,7 +20,7 @@ extension FamiliarFollowersDashboardView {
viewModel.emojis = {
var array: [Mastodon.Entity.Emoji] = []
for account in accounts {
array.append(contentsOf: account.emojis ?? [])
array.append(contentsOf: account.emojis)
}
return array.asDictionary
}()

View File

@ -91,7 +91,7 @@ extension StatusView {
let account = authenticationBox.authentication.account() {
let name = account.displayNameWithFallback
let emojis = account.emojis ?? []
let emojis = account.emojis
viewModel.header = {
let text = L10n.Common.Controls.Status.userReblogged(name)
@ -106,7 +106,7 @@ extension StatusView {
}()
} else if status.reblog != nil {
let name = status.entity.account.displayNameWithFallback
let emojis = status.entity.account.emojis ?? []
let emojis = status.entity.account.emojis
viewModel.header = {
let text = L10n.Common.Controls.Status.userReblogged(name)