Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lings03 committed Jan 24, 2025
1 parent acf98cf commit 92aae2e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ data class ModUiState(
val disableModList: List<ModBean> = emptyList(), // 关闭mod列表
val searchModList: List<ModBean> = emptyList(), // 搜索mod列表
val isLoading: Boolean = false, // 是否正在加载
val isRefreshing: Boolean = false,
val openPermissionRequestDialog: Boolean = false, // 是否打开权限请求对话框
val modDetail: ModBean? = null, // 打开的mod详情
val showModDetail: Boolean = false, // 是否显示mod详情
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ fun ModPage(viewModel: ModViewModel) {
}
if (uiState.isLoading) {
Loading(uiState.loadingPath)
} else if (uiState.isRefreshing) {
Loading(stringResource(R.string.mod_refreshing))
} else {
uiState.modDetail?.let {
ModDetailPartialBottomSheet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,6 @@ class ModViewModel(
_uiState.value = _uiState.value.copy(isLoading = isLoading)
}

fun setRefreshing(isRefreshing: Boolean) {
_uiState.value = _uiState.value.copy(isRefreshing = isRefreshing)
}

// 设置加载目录
private suspend fun setLoadingPath(loadingPath: String) {
withContext(Dispatchers.Main) {
Expand Down Expand Up @@ -1112,7 +1108,6 @@ class ModViewModel(
}

fun refreshModDetail() {
setRefreshing(true)
val modBean = _uiState.value.modDetail!!

// 启动协程等待解压并读取完成
Expand All @@ -1122,8 +1117,6 @@ class ModViewModel(

val newModBean = flashModDetail(modBean)

setShowModDetail(false)

LogTools.logRecord("old:$modBean")
LogTools.logRecord("new:$newModBean")

Expand All @@ -1148,8 +1141,6 @@ class ModViewModel(

LogTools.logRecord("use:" + modRepository.getModById(modBean.id).toString())
}

setRefreshing(false)
}
}

Expand Down

0 comments on commit 92aae2e

Please sign in to comment.