Skip to content
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

fix: clock list performance issues #242

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

SuhasDissa
Copy link
Member

No description provided.

@SuhasDissa SuhasDissa requested a review from Bnyro December 10, 2023 06:17
var sortOrder by mutableStateOf(
if (sortOrderPref.isNotEmpty()) SortOrder.valueOf(sortOrderPref) else SortOrder.ALPHABETIC
)
var sortOrder: SortOrder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var sortOrder: SortOrder
var sortOrder by lazy {
val sortOrderPref =
Preferences.instance.getString(Preferences.clockSortOrder, "").orEmpty()
sortOrder =
if (sortOrderPref.isNotEmpty()) SortOrder.valueOf(sortOrderPref) else SortOrder.ALPHABETIC
updateSortOrder(sortOrder)
sortOrder
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(That's just so that the initialization of the variable is at the place where it's created)

Copy link
Member

@Bnyro Bnyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm (with one small suggestion)

@SuhasDissa SuhasDissa merged commit c643b7f into you-apps:main Dec 12, 2023
1 check passed
@SuhasDissa SuhasDissa deleted the clock-performance branch December 17, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants