Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Fix spelling #269

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ServiceLayer/Sources/ServiceLayer/Entities/PickerEmoji.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Foundation
import Mastodon

public indirect enum PickerEmoji: Hashable {
case custom(Emoji, inFrequentlyUsed: Bool)
case system(SystemEmoji, inFrequentlyUsed: Bool)
case custom(Emoji, infrequentlyUsed: Bool)
case system(SystemEmoji, infrequentlyUsed: Bool)
}

public extension PickerEmoji {
Expand Down Expand Up @@ -43,12 +43,12 @@ public extension PickerEmoji {
}
}

var inFrequentlyUsed: Self {
var infrequentlyUsed: Self {
switch self {
case let .custom(emoji, _):
return .custom(emoji, inFrequentlyUsed: true)
return .custom(emoji, infrequentlyUsed: true)
case let .system(emoji, _):
return .system(emoji, inFrequentlyUsed: true)
return .system(emoji, infrequentlyUsed: true)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public extension EmojiPickerService {
}

if typed[category] == nil {
typed[category] = [.custom(emoji, inFrequentlyUsed: false)]
typed[category] = [.custom(emoji, infrequentlyUsed: false)]
} else {
typed[category]?.append(.custom(emoji, inFrequentlyUsed: false))
typed[category]?.append(.custom(emoji, infrequentlyUsed: false))
}
}

Expand Down Expand Up @@ -73,7 +73,7 @@ public extension EmojiPickerService {
.map {
PickerEmoji.system(
$0.withMaxVersionForSkinToneVariations(Self.maxEmojiVersion),
inFrequentlyUsed: false)
infrequentlyUsed: false)
}
}

Expand Down
4 changes: 2 additions & 2 deletions View Controllers/EmojiPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ final class EmojiPickerViewController: UICollectionViewController {
contextMenuConfigurationForItemAt indexPath: IndexPath,
point: CGPoint) -> UIContextMenuConfiguration? {
guard let item = dataSource.itemIdentifier(for: indexPath),
case let .system(emoji, inFrequentlyUsed) = item,
case let .system(emoji, infrequentlyUsed) = item,
!emoji.skinToneVariations.isEmpty
else { return nil }

return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { _ in
UIMenu(children: ([emoji] + emoji.skinToneVariations).map { skinToneVariation in
UIAction(title: skinToneVariation.emoji) { [weak self] _ in
self?.select(emoji: .system(skinToneVariation, inFrequentlyUsed: inFrequentlyUsed))
self?.select(emoji: .system(skinToneVariation, infrequentlyUsed: infrequentlyUsed))
self?.viewModel.updateUse(emoji: item)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import Foundation

public extension PickerEmoji {
func applyingDefaultSkinTone(identityContext: IdentityContext) -> PickerEmoji {
if case let .system(systemEmoji, inFrequentlyUsed) = self,
if case let .system(systemEmoji, infrequentlyUsed) = self,
let defaultEmojiSkinTone = identityContext.appPreferences.defaultEmojiSkinTone {
return .system(systemEmoji.applying(skinTone: defaultEmojiSkinTone), inFrequentlyUsed: inFrequentlyUsed)
return .system(systemEmoji.applying(skinTone: defaultEmojiSkinTone), infrequentlyUsed: infrequentlyUsed)
} else {
return self
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ final public class EmojiPickerViewModel: ObservableObject {
emojis[.frequentlyUsed] = emojiUses.compactMap { use in
emojis.values.reduce([], +)
.first { use.system == $0.system && use.emoji == $0.name }
.map(\.inFrequentlyUsed)
.map(\.infrequentlyUsed)
}
}

Expand Down