Skip to content

Commit

Permalink
Update the Select Interests presentation logic
Browse files Browse the repository at this point in the history
Previously, we only show the Select Interests view (i.e., the tag
cloud) when the user has 0 tags.

Now that the backend auto-subscribes new users to the `dailyprompt`
tag, this change will cause them to see the Select Interests view
despite having subscribed to the dailyprompt tag.
  • Loading branch information
dvdchr committed Feb 2, 2024
1 parent 51a98fb commit f25f9ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions WordPress/Classes/Extensions/Post+BloggingPrompts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ extension Post {
"""
}

private enum Strings {
enum Strings {
static let promptTag = "dailyprompt"
static let emptyParagraphBlock = """
fileprivate static let emptyParagraphBlock = """
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ class ReaderSelectInterestsCoordinator {
return
}

let isFollowingInterests = interests.count > 0
let isFollowingInterests = {
// New users are automatically subscribed to the 'dailyprompt' tag by default.
// Let's ignore this value and keep showing the Select Interests view if the user
// is not subscribed to any other tags.
if let interest = interests.first,
interests.count == 1 {
return interest.slug != Post.Strings.promptTag
}
return interests.count > 0
}()

completion(isFollowingInterests)
}
}
Expand Down

0 comments on commit f25f9ed

Please sign in to comment.