Skip to content

Commit

Permalink
fix: 修复空数据崩溃
Browse files Browse the repository at this point in the history
修复了周次选择、空教室选择和多选选择在空数据时崩溃的问题。
更新了默认学年学期和开学日期。
  • Loading branch information
Mystery00 committed Aug 27, 2024
1 parent 121e0f1 commit 6567634
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ConfigStore internal constructor() {
return Customisable(LocalDate.parse(value, Formatter.DATE), false)
}
// 默认值
return Customisable(LocalDate.of(2024, 2, 26), false)
return Customisable(LocalDate.of(2024, 9, 2), false)
}

//当前学年
Expand Down Expand Up @@ -99,7 +99,7 @@ class ConfigStore internal constructor() {
return Customisable(value, false)
}
// 默认值
return Customisable(2023, false)
return Customisable(2024, false)
}

//当前学期
Expand Down Expand Up @@ -127,7 +127,7 @@ class ConfigStore internal constructor() {
return Customisable(value, false)
}
// 默认值
return Customisable(2, false)
return Customisable(1, false)
}

//在周课表中显示自定义课程
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class CourseRoomActivity : BaseSelectComposeActivity() {
columnSize: Int,
onSelect: (List<Int>) -> Unit,
) {
if (selectList.isEmpty()) return
if (show.showing) {
var config = OptionConfig(mode = DisplayMode.LIST)
if (columnSize > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ private fun WeekViewDialog(
currentWeek: Int,
onWeekChange: (Int) -> Unit = {},
) {
if (weekView.isEmpty()) return
val options = weekView.map {
Option(
titleText = "${it.weekNum}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ class XhuDialogState(initialValue: Boolean = false) {
showing = false
}

fun toggle() {
showing = !showing
}

companion object {
fun Saver(): Saver<XhuDialogState, Boolean> = Saver(
save = { it.showing },
Expand Down

0 comments on commit 6567634

Please sign in to comment.