-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reader: Add Freshly Pressed #24828
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
base: trunk
Are you sure you want to change the base?
Reader: Add Freshly Pressed #24828
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| 26.6 | ||
| ----- | ||
|
|
||
| * [**] Add "Freshly Pressed" to Discover in Reader [#24828] | ||
|
|
||
| 26.5 | ||
| ----- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,18 @@ | |
| return topic.path.hasSuffix("/freshly-pressed") | ||
| } | ||
|
|
||
| public static func getFreshlyPressedTopic(in context: NSManagedObjectContext = ContextManager.shared.mainContext) -> ReaderSiteTopic { | ||
| let path = "/rest/v1.2/freshly-pressed" | ||
|
Check warning on line 122 in WordPress/Classes/ViewRelated/Reader/Controllers/ReaderHelpers.swift
|
||
| if let topic = try? ReaderSiteTopic.lookup(withFeedURL: path, in: context) { | ||
| return topic | ||
| } | ||
| let topic = context.insertNewObject(ofType: ReaderSiteTopic.self) | ||
| topic.feedURL = path | ||
| topic.path = path | ||
| try? context.save() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have many places in the app that save the main context. Maybe use |
||
| return topic | ||
| } | ||
|
|
||
| /// Check if the specified topic is for Discover | ||
| /// | ||
| /// - Parameters: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured we can opt-out of these on the app side as we never want mshots to be used from the app.