Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Status from CoreData #1167

Merged
merged 63 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b010b61
Remove usage of Status (IOS-176)
kimar Nov 22, 2023
9ce078c
Fix loading of home timeline (IOS-176)
kimar Nov 22, 2023
d0893d5
Fix notifications timeline loading (IOS-176)
kimar Nov 22, 2023
e3f3e2c
Merge branch 'develop' into remove_status
kimar Nov 22, 2023
36d4f6e
Fix threads not working (IOS-176)
kimar Nov 22, 2023
9809e69
Fix favorite action (IOS-176)
kimar Nov 22, 2023
e0671eb
Reimplement favorite/reblog state (IOS-176)
kimar Nov 23, 2023
1dfcf40
Merge branch 'develop' into remove_status
kimar Nov 23, 2023
c7d62d5
Fix handling of (re-)reblogged and favorites state in home timeline (…
kimar Nov 27, 2023
4cb845e
Fix manual refresh of home timeline not working (IOS-176)
kimar Nov 27, 2023
faac99c
Fix duplicate entry after reblog (IOS-176)
kimar Nov 27, 2023
9c5e193
Reimplement timeline anchoring (IOS-176)
kimar Nov 27, 2023
cc3f1d0
Merge branch 'develop' into remove_status
kimar Nov 27, 2023
8316651
Fix tabbar avatar not visible (IOS-176)
kimar Nov 27, 2023
a322a46
Don't try to resolve self-relationship
kimar Nov 28, 2023
167e0e4
Fix translate not working (IOS-176)
kimar Nov 28, 2023
03aeb1f
Merge branch 'develop' into remove_status
kimar Nov 28, 2023
9fed54d
Fix compile issues after resolving merge conflicts
kimar Nov 28, 2023
45accb2
Fix CW cannot be hidden (IOS-176)
kimar Nov 28, 2023
7ad0b15
Fix bookmarked state (IOS-176)
kimar Nov 28, 2023
66b2bfd
Fix missing case in StatusFetchedResultsController
kimar Nov 28, 2023
1f73bee
Improve StatusFetchedResultsController update handling (IOS-176)
kimar Nov 28, 2023
112dce0
Improve flickering when interacting with posts (IOS-176)
kimar Dec 1, 2023
38423a1
Preserve isSensitiveToggled state when interacting with posts (IOS-176)
kimar Dec 1, 2023
28cdd67
Fix sensitive toggled state for reblogs (IOS-176)
kimar Dec 1, 2023
e6ba8db
Merge branch 'develop' into remove_status
kimar Dec 1, 2023
837d8dd
Fix user profile not loaded from status on home timeline (IOS-176)
kimar Dec 1, 2023
5532324
Implement caching for home timeline items (IOS-176)
kimar Dec 1, 2023
b57f38d
Fix status eventuall nil MastodonNotification
kimar Dec 4, 2023
63e45d6
Fix notifications show empty view (IOS-198)
kimar Dec 4, 2023
a1cd169
Implement cache for Notifications (IOS-200)
kimar Dec 4, 2023
69a92c3
Fix eventually incorrect domain used
kimar Dec 4, 2023
7323cb9
Fix missing poll information (IOS-201)
kimar Dec 4, 2023
0f3c50b
Fix non-ui-thread modification in when editing poll (IOS-203)
kimar Dec 4, 2023
86d3088
Remove unused code
kimar Dec 4, 2023
a4db8a2
Fix Poll appearance / layout / issues (IOS-201)
kimar Dec 5, 2023
c30fb73
Fix status deletion not updating data model (IOS-205)
kimar Dec 5, 2023
1754375
Fix favorited post might lose repost header (IOS-206)
kimar Dec 7, 2023
d1ba457
Remove status persistence (IOS-176)
kimar Dec 7, 2023
b0bdaac
Fix CW layout issues (IOS-207)
kimar Dec 8, 2023
ab689d3
Fix status thread CW not shown and interacted status not updated (IOS…
kimar Dec 8, 2023
7fb8fca
Fix issue caused by duplicate IDs after reloadingtimeline
kimar Dec 12, 2023
31796f1
Implement thread reload after publishing reply (IOS-176)
kimar Dec 13, 2023
9167260
Update datasource on delete statuses in timelines and thread (IOS-212)
kimar Dec 14, 2023
d759a4b
Update posts on timeline and thread if edited (IOS-211)
kimar Dec 14, 2023
22324f4
Fix Polls not showing up (IOS-213)
kimar Dec 14, 2023
275fa53
Fix DataSourceFacade+Bookmark protocol constraints (IOS-176)
kimar Dec 27, 2023
82cc0f2
Tie JSON cache to domain based unique identifier
kimar Dec 27, 2023
f6e5f53
Remove unused code
kimar Dec 27, 2023
4874615
Fix incorrectly named variable
kimar Dec 27, 2023
80df919
Remove switch case
kimar Dec 27, 2023
405b175
Implement alternative Author for DataSourceFacade.MenuContext (IOS-176)
kimar Dec 27, 2023
bf433e3
Address PR Feedback (IOS-176)
kimar Dec 28, 2023
2018d7c
Hide loading spinner after network requesty
kimar Jan 2, 2024
54b020f
Remove dead code
kimar Jan 2, 2024
c354eeb
Move poll query code to MastodonStatus
kimar Jan 2, 2024
0045e7d
Fix "reposted by ..." disappears when post get's (un-)favorited
kimar Jan 3, 2024
7af1bea
Rename classes
kimar Jan 3, 2024
4561dc5
Merge branch 'develop' into remove_status
kimar Jan 4, 2024
c1ad3e2
Rename properties
kimar Jan 4, 2024
97bfdab
Remove unused property
kimar Jan 4, 2024
f50d48d
Remove redundant main actor dispatch
kimar Jan 4, 2024
8e0c45f
Revert data propagation order in SearchResultViewModel
kimar Jan 8, 2024
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
8 changes: 4 additions & 4 deletions Mastodon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
2AE202AC297FE19100F66E55 /* FollowersCountIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AE202AB297FE19100F66E55 /* FollowersCountIntentHandler.swift */; };
2AE202AD297FE1CD00F66E55 /* WidgetExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A72813E297EC762004138C5 /* WidgetExtension.swift */; };
2AE244482927831100BDBF7C /* UIImage+SFSymbols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AE244472927831100BDBF7C /* UIImage+SFSymbols.swift */; };
2AF2E7BF2B19DC6E00D98917 /* FileManager+Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AF2E7BE2B19DC6E00D98917 /* FileManager+Timeline.swift */; };
2D198643261BF09500F0B013 /* SearchResultItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D198642261BF09500F0B013 /* SearchResultItem.swift */; };
2D198649261C0B8500F0B013 /* SearchResultSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D198648261C0B8500F0B013 /* SearchResultSection.swift */; };
2D206B8625F5FB0900143C56 /* Double.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D206B8525F5FB0900143C56 /* Double.swift */; };
Expand Down Expand Up @@ -393,7 +394,6 @@
DB9282B225F3222800823B15 /* PickServerEmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB9282B125F3222800823B15 /* PickServerEmptyStateView.swift */; };
DB938EE62623F50700E5B6C1 /* ThreadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB938EE52623F50700E5B6C1 /* ThreadViewController.swift */; };
DB938EED2623F79B00E5B6C1 /* ThreadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB938EEC2623F79B00E5B6C1 /* ThreadViewModel.swift */; };
DB938F0326240EA300E5B6C1 /* CachedThreadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB938F0226240EA300E5B6C1 /* CachedThreadViewModel.swift */; };
DB938F0926240F3C00E5B6C1 /* RemoteThreadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB938F0826240F3C00E5B6C1 /* RemoteThreadViewModel.swift */; };
DB938F0F2624119800E5B6C1 /* ThreadViewModel+LoadThreadState.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB938F0E2624119800E5B6C1 /* ThreadViewModel+LoadThreadState.swift */; };
DB938F1F2624382F00E5B6C1 /* ThreadViewModel+Diffable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB938F1E2624382F00E5B6C1 /* ThreadViewModel+Diffable.swift */; };
Expand Down Expand Up @@ -696,6 +696,7 @@
2AE202A9297FDDF500F66E55 /* WidgetExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WidgetExtension.entitlements; sourceTree = "<group>"; };
2AE202AB297FE19100F66E55 /* FollowersCountIntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FollowersCountIntentHandler.swift; sourceTree = "<group>"; };
2AE244472927831100BDBF7C /* UIImage+SFSymbols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+SFSymbols.swift"; sourceTree = "<group>"; };
2AF2E7BE2B19DC6E00D98917 /* FileManager+Timeline.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileManager+Timeline.swift"; sourceTree = "<group>"; };
2D198642261BF09500F0B013 /* SearchResultItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultItem.swift; sourceTree = "<group>"; };
2D198648261C0B8500F0B013 /* SearchResultSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultSection.swift; sourceTree = "<group>"; };
2D206B8525F5FB0900143C56 /* Double.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Double.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1115,7 +1116,6 @@
DB9282B125F3222800823B15 /* PickServerEmptyStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickServerEmptyStateView.swift; sourceTree = "<group>"; };
DB938EE52623F50700E5B6C1 /* ThreadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadViewController.swift; sourceTree = "<group>"; };
DB938EEC2623F79B00E5B6C1 /* ThreadViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadViewModel.swift; sourceTree = "<group>"; };
DB938F0226240EA300E5B6C1 /* CachedThreadViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CachedThreadViewModel.swift; sourceTree = "<group>"; };
DB938F0826240F3C00E5B6C1 /* RemoteThreadViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteThreadViewModel.swift; sourceTree = "<group>"; };
DB938F0E2624119800E5B6C1 /* ThreadViewModel+LoadThreadState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ThreadViewModel+LoadThreadState.swift"; sourceTree = "<group>"; };
DB938F1E2624382F00E5B6C1 /* ThreadViewModel+Diffable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ThreadViewModel+Diffable.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1898,6 +1898,7 @@
children = (
D8AC98772B0F62230045EC2B /* Model */,
D8AC98752B0F61680045EC2B /* FileManager+SearchHistory.swift */,
2AF2E7BE2B19DC6E00D98917 /* FileManager+Timeline.swift */,
);
path = Persistence;
sourceTree = "<group>";
Expand Down Expand Up @@ -2687,7 +2688,6 @@
DB938EEC2623F79B00E5B6C1 /* ThreadViewModel.swift */,
DB938F1E2624382F00E5B6C1 /* ThreadViewModel+Diffable.swift */,
DB938F0E2624119800E5B6C1 /* ThreadViewModel+LoadThreadState.swift */,
DB938F0226240EA300E5B6C1 /* CachedThreadViewModel.swift */,
DB938F0826240F3C00E5B6C1 /* RemoteThreadViewModel.swift */,
DB0FCB7F27968F70006C02E2 /* MastodonStatusThreadViewModel.swift */,
);
Expand Down Expand Up @@ -3909,7 +3909,6 @@
2AB5011C299243FB00346092 /* WidgetExtension.intentdefinition in Sources */,
DB9F58F126EF512300E7BBE9 /* AccountListTableViewCell.swift in Sources */,
2D76319F25C1521200929FB9 /* StatusSection.swift in Sources */,
DB938F0326240EA300E5B6C1 /* CachedThreadViewModel.swift in Sources */,
DBA5A53526F0A36A00CACBAA /* AddAccountTableViewCell.swift in Sources */,
2D35237A26256D920031AF25 /* NotificationSection.swift in Sources */,
DB98EB6927B21A7C0082E365 /* ReportResultActionTableViewCell.swift in Sources */,
Expand Down Expand Up @@ -3978,6 +3977,7 @@
DB9F58EC26EF435000E7BBE9 /* AccountViewController.swift in Sources */,
D8318A802A4466D300C0FB73 /* SettingsCoordinator.swift in Sources */,
DB3E6FF12806D96900B035AE /* DiscoveryNewsViewModel+Diffable.swift in Sources */,
2AF2E7BF2B19DC6E00D98917 /* FileManager+Timeline.swift in Sources */,
DB3E6FF82807C45300B035AE /* DiscoveryForYouViewModel.swift in Sources */,
DB0F9D56283EB46200379AF8 /* ProfileHeaderView+Configuration.swift in Sources */,
DB6746F0278F463B008A6B94 /* AutoGenerateProtocolDelegate.swift in Sources */,
Expand Down
10 changes: 8 additions & 2 deletions Mastodon/Coordinator/SceneCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,10 @@ public extension SceneCoordinator {
@MainActor
func showLoading(on viewController: UIViewController?) {
guard let viewController else { return }


/// Don't add HUD twice
guard MBProgressHUD.forView(viewController.view) == nil else { return }

MBProgressHUD.showAdded(to: viewController.view, animated: true)
}

Expand Down Expand Up @@ -626,7 +629,10 @@ extension SceneCoordinator: SettingsCoordinatorDelegate {
try await self.appContext.authenticationService.signOutMastodonUser(
authenticationBox: authContext.mastodonAuthenticationBox
)

let userIdentifier = authContext.mastodonAuthenticationBox
FileManager.default.invalidateHomeTimelineCache(for: userIdentifier)
FileManager.default.invalidateNotificationsAll(for: userIdentifier)
FileManager.default.invalidateNotificationsMentions(for: userIdentifier)
self.setup()
}

Expand Down
6 changes: 3 additions & 3 deletions Mastodon/Diffable/Notification/NotificationItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import CoreData
import Foundation
import CoreDataStack
import MastodonSDK

enum NotificationItem: Hashable {
case feed(record: ManagedObjectRecord<Feed>)
case feedLoader(record: ManagedObjectRecord<Feed>)
case feed(record: MastodonFeed)
case feedLoader(record: MastodonFeed)
case bottomLoader
}
19 changes: 8 additions & 11 deletions Mastodon/Diffable/Notification/NotificationSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ extension NotificationSection {

return UITableViewDiffableDataSource(tableView: tableView) { tableView, indexPath, item -> UITableViewCell? in
switch item {
case .feed(let record):
case .feed(let feed):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: NotificationTableViewCell.self), for: indexPath) as! NotificationTableViewCell
context.managedObjectContext.performAndWait {
guard let feed = record.object(in: context.managedObjectContext) else { return }
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: NotificationTableViewCell.ViewModel(value: .feed(feed)),
configuration: configuration
)
}
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: NotificationTableViewCell.ViewModel(value: .feed(feed)),
configuration: configuration
)
return cell
case .feedLoader:
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: TimelineBottomLoaderTableViewCell.self), for: indexPath) as! TimelineBottomLoaderTableViewCell
Expand Down
3 changes: 2 additions & 1 deletion Mastodon/Diffable/Report/ReportItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

import Foundation
import CoreDataStack
import MastodonSDK

enum ReportItem: Hashable {
case header(context: HeaderContext)
case status(record: ManagedObjectRecord<Status>)
case status(record: MastodonStatus)
case comment(context: CommentContext)
case result(record: ManagedObjectRecord<MastodonUser>)
case bottomLoader
Expand Down
19 changes: 8 additions & 11 deletions Mastodon/Diffable/Report/ReportSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,15 @@ extension ReportSection {
cell.primaryLabel.text = headerContext.primaryLabelText
cell.secondaryLabel.text = headerContext.secondaryLabelText
return cell
case .status(let record):
case .status(let status):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ReportStatusTableViewCell.self), for: indexPath) as! ReportStatusTableViewCell
context.managedObjectContext.performAndWait {
guard let status = record.object(in: context.managedObjectContext) else { return }
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: .init(value: status),
configuration: configuration
)
}
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: .init(value: status),
configuration: configuration
)
return cell
case .comment(let commentContext):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ReportCommentTableViewCell.self), for: indexPath) as! ReportCommentTableViewCell
Expand Down
13 changes: 7 additions & 6 deletions Mastodon/Diffable/Status/StatusItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
import Foundation
import CoreDataStack
import MastodonUI
import MastodonSDK

enum StatusItem: Hashable {
case feed(record: ManagedObjectRecord<Feed>)
case feedLoader(record: ManagedObjectRecord<Feed>)
case status(record: ManagedObjectRecord<Status>)
case feed(record: MastodonFeed)
case feedLoader(record: MastodonFeed)
case status(record: MastodonStatus)
case thread(Thread)
case topLoader
case bottomLoader
Expand All @@ -24,7 +25,7 @@ extension StatusItem {
case reply(context: Context)
case leaf(context: Context)

public var record: ManagedObjectRecord<Status> {
public var record: MastodonStatus {
switch self {
case .root(let threadContext),
.reply(let threadContext),
Expand All @@ -37,12 +38,12 @@ extension StatusItem {

extension StatusItem.Thread {
class Context: Hashable {
let status: ManagedObjectRecord<Status>
let status: MastodonStatus
var displayUpperConversationLink: Bool
var displayBottomConversationLink: Bool

init(
status: ManagedObjectRecord<Status>,
status: MastodonStatus,
displayUpperConversationLink: Bool = false,
displayBottomConversationLink: Bool = false
) {
Expand Down
95 changes: 39 additions & 56 deletions Mastodon/Diffable/Status/StatusSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,33 @@ extension StatusSection {

return UITableViewDiffableDataSource(tableView: tableView) { tableView, indexPath, item -> UITableViewCell? in
switch item {
case .feed(let record):
case .feed(let feed):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: StatusTableViewCell.self), for: indexPath) as! StatusTableViewCell
context.managedObjectContext.performAndWait {
guard let feed = record.object(in: context.managedObjectContext) else { return }
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusTableViewCell.ViewModel(value: .feed(feed)),
configuration: configuration
)
}
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusTableViewCell.ViewModel(value: .feed(feed)),
configuration: configuration
)
return cell
case .feedLoader(let record):
case .feedLoader(let feed):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: TimelineMiddleLoaderTableViewCell.self), for: indexPath) as! TimelineMiddleLoaderTableViewCell
context.managedObjectContext.performAndWait {
guard let feed = record.object(in: context.managedObjectContext) else { return }
configure(
cell: cell,
feed: feed,
configuration: configuration
)
}
configure(
cell: cell,
feed: feed,
configuration: configuration
)
return cell
case .status(let record):
case .status(let status):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: StatusTableViewCell.self), for: indexPath) as! StatusTableViewCell
context.managedObjectContext.performAndWait {
guard let status = record.object(in: context.managedObjectContext) else { return }
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusTableViewCell.ViewModel(value: .status(status)),
configuration: configuration
)
}
configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusTableViewCell.ViewModel(value: .status(status)),
configuration: configuration
)
return cell
case .thread(let thread):
let cell = dequeueConfiguredReusableCell(
Expand Down Expand Up @@ -118,36 +109,28 @@ extension StatusSection {
tableView: UITableView,
indexPath: IndexPath,
configuration: ThreadCellRegistrationConfiguration
) -> UITableViewCell {
let managedObjectContext = context.managedObjectContext

) -> UITableViewCell {
switch configuration.thread {
case .root(let threadContext):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: StatusThreadRootTableViewCell.self), for: indexPath) as! StatusThreadRootTableViewCell
managedObjectContext.performAndWait {
guard let status = threadContext.status.object(in: managedObjectContext) else { return }
StatusSection.configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusThreadRootTableViewCell.ViewModel(value: .status(status)),
configuration: configuration.configuration
)
}
StatusSection.configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusThreadRootTableViewCell.ViewModel(value: .status(threadContext.status)),
configuration: configuration.configuration
)
return cell
case .reply(let threadContext),
.leaf(let threadContext):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: StatusTableViewCell.self), for: indexPath) as! StatusTableViewCell
managedObjectContext.performAndWait {
guard let status = threadContext.status.object(in: managedObjectContext) else { return }
StatusSection.configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusTableViewCell.ViewModel(value: .status(status)),
configuration: configuration.configuration
)
}
StatusSection.configure(
context: context,
tableView: tableView,
cell: cell,
viewModel: StatusTableViewCell.ViewModel(value: .status(threadContext.status)),
configuration: configuration.configuration
)
return cell
}
}
Expand Down Expand Up @@ -182,7 +165,7 @@ extension StatusSection {
return
}

cell.pollOptionView.configure(pollOption: option)
cell.pollOptionView.configure(pollOption: option, status: statusView.viewModel.originalStatus)

// trigger update if needs
let needsUpdatePoll: Bool = {
Expand Down Expand Up @@ -319,7 +302,7 @@ extension StatusSection {

static func configure(
cell: TimelineMiddleLoaderTableViewCell,
feed: Feed,
feed: MastodonFeed,
configuration: Configuration
) {
cell.configure(
Expand Down
10 changes: 7 additions & 3 deletions Mastodon/Persistence/FileManager+SearchHistory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ extension FileManager {
}
}

extension FileManager {
public var documentsDirectory: URL? {
return self.urls(for: .documentDirectory, in: .userDomainMask).first
public extension FileManager {
var documentsDirectory: URL? {
urls(for: .documentDirectory, in: .userDomainMask).first
}

var cachesDirectory: URL? {
urls(for: .cachesDirectory, in: .userDomainMask).first
}
}
Loading
Loading