Skip to content

[Pref DataStore] Deadline & Priority switches go in infinite loop #31

@anidhamal

Description

@anidhamal

Issue :: When both deadline and priority are selected, leaving the app and reopening, makes deadline & priority switches go in infinite loop
Steps to reproduce:

  • Launch app from preferences_datastore branch
  • Select both deadline and priority option
  • exit the app by back pressing
  • launch the app again
  • deadline and priority switches go in infinite loop

Why::
After reopening,
updateSort -> enableSortByPriority -> SortOrder.BY_PRIORITY -> updateSort -> enableSortByDeadline -> SortOrder.BY_DEADLINE_AND_PRIORITY -> enableSortByPriority -> SortOrder.BY_PRIORITY -> updateSort -> ♾

Solution ::
Inside enableSortByPriority / enableSortByDeadline mtds, check if the argument is enable and SortOrder is BY_DEADLINE_AND_PRIORITY, return from the mtds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions