Skip to content

The way the interests feature stores the currently selected topic ID violates SSOT #2006

@dturner

Description

@dturner

On the InterestsScreen when a user taps on a topic, 2 things happen:

  • a navigation event which pushes TopicNavKey(topicId) on to the back stack
  • InterestsViewModel is updated with the selected topic Id

This violates SSOT because the currently selected topic Id is now stored in 2 places. We should come up with a better way of doing this. Ideas:

  • Have InterestsViewModel derive the current selected topic id from the TopicNavKey on the back stack. This would require InterestsViewModel having access to NavigationState.
  • Pass the navigator to InterestsViewModel. Then its onTopicClick method can navigate as well as updating its own currently selected topic ID (still violates SSOT but is architecturally better and simpler to implement).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions