Refactor: Add debounce for navigation and optimize comments loading
- Implemented debounced navigation to prevent multiple rapid navigations. - Replaced Pager-based comment loading with a simpler list-based approach for improved performance and reduced complexity. - Added loading and error states for comment fetching. - Introduced `debouncedClickable` modifier for handling click events with debounce. - Updated image viewer to use simple navigation arrows instead of HorizontalPager for better user experience. - Added a new string resource for password length error.
This commit is contained in:
@@ -11,6 +11,7 @@ import com.aiosman.ravenow.ui.index.tabs.moment.tabs.dynamic.DynamicViewModel
|
||||
import com.aiosman.ravenow.ui.index.tabs.moment.tabs.hot.HotMomentViewModel
|
||||
import com.aiosman.ravenow.ui.index.tabs.moment.tabs.timeline.TimelineMomentViewModel
|
||||
import com.aiosman.ravenow.ui.index.tabs.profile.MyProfileViewModel
|
||||
import com.aiosman.ravenow.ui.account.AccountEditViewModel
|
||||
import com.aiosman.ravenow.ui.index.tabs.search.DiscoverViewModel
|
||||
import com.aiosman.ravenow.ui.index.tabs.search.SearchViewModel
|
||||
import com.aiosman.ravenow.ui.index.tabs.message.MessageListViewModel
|
||||
@@ -85,6 +86,9 @@ object ResourceCleanupManager {
|
||||
// 重置个人资料相关ViewModel
|
||||
MyProfileViewModel.ResetModel()
|
||||
|
||||
// 重置编辑资料ViewModel - 暂时注释掉
|
||||
// AccountEditViewModel.ResetModel()
|
||||
|
||||
// 重置搜索相关ViewModel
|
||||
// DiscoverViewModel的属性是私有的,无法直接访问,通过其他方式清理
|
||||
|
||||
@@ -237,6 +241,7 @@ object ResourceCleanupManager {
|
||||
}
|
||||
"profile" -> {
|
||||
MyProfileViewModel.ResetModel()
|
||||
// AccountEditViewModel.ResetModel() - 暂时注释掉
|
||||
}
|
||||
"search" -> {
|
||||
// DiscoverViewModel的属性是私有的,无法直接访问
|
||||
|
||||
Reference in New Issue
Block a user