Skip to content

Commit

Permalink
Remove ReaderContentType
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Nov 9, 2024
1 parent 2c1d3ac commit 5989c03
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,38 +232,6 @@ struct ReaderNotificationKeys {
Blog.lookup(withID: siteID, in: ContextManager.sharedInstance().mainContext)?.isAdmin ?? false
}

// convenience method that returns the topic type
class func topicType(_ topic: ReaderAbstractTopic?) -> ReaderTopicType {
guard let topic = topic else {
return .noTopic
}
if topicIsDiscover(topic) {
return .discover
}
if topicIsFollowing(topic) {
return .following
}
if topicIsLiked(topic) {
return .likes
}
if isTopicList(topic) {
return .list
}
if isTopicSearchTopic(topic) {
return .search
}
if isTopicSite(topic) {
return .site
}
if isTopicTag(topic) {
return .tag
}
if topic is ReaderTeamTopic {
return .organization
}
return .noTopic
}

// MARK: Logged in helper

@objc open class func isLoggedIn() -> Bool {
Expand Down Expand Up @@ -499,19 +467,6 @@ struct ReaderNotificationKeys {
}
}

/// Typed topic type
enum ReaderTopicType {
case discover
case following
case likes
case list
case search
case site
case tag
case organization
case noTopic
}

@objc enum SiteOrganizationType: Int {
// site does not belong to an organization
case none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ final class ReaderSidebarViewModel: ObservableObject {
.first(where: ReaderHelpers.topicIsLiked)
}

func getTopic(for topicType: ReaderTopicType) -> ReaderAbstractTopic? {
return try? ReaderAbstractTopic.lookupAllMenus(in: contextManager.mainContext).first {
ReaderHelpers.topicType($0) == topicType
}
}

func onAppear() {
reloadMenuIfNeeded()
}
Expand Down Expand Up @@ -117,16 +111,6 @@ enum ReaderStaticScreen: String, CaseIterable, Identifiable, Hashable {
}
}

var topicType: ReaderTopicType? {
switch self {
case .recent: .following
case .discover: .discover
case .saved: nil
case .likes: .likes
case .search: nil
}
}

var accessibilityIdentifier: String {
"reader_sidebar_\(rawValue)"
}
Expand Down

0 comments on commit 5989c03

Please sign in to comment.