diff --git a/lib/pages/html/controller.dart b/lib/pages/html/controller.dart index 499e88a8f..2761fb481 100644 --- a/lib/pages/html/controller.dart +++ b/lib/pages/html/controller.dart @@ -22,9 +22,9 @@ class HtmlRenderController extends GetxController { RxInt acount = 0.obs; final ScrollController scrollController = ScrollController(); - ReplySortType _sortType = ReplySortType.time; - RxString sortTypeTitle = ReplySortType.time.titles.obs; - RxString sortTypeLabel = ReplySortType.time.labels.obs; + late ReplySortType _sortType; + late RxString sortTypeTitle; + late RxString sortTypeLabel; Box setting = GStrorage.setting; @override @@ -33,6 +33,15 @@ class HtmlRenderController extends GetxController { id = Get.parameters['id']!; dynamicType = Get.parameters['dynamicType']!; type = dynamicType == 'picture' ? 11 : 12; + int defaultReplySortIndex = + setting.get(SettingBoxKey.replySortType, defaultValue: 0) as int; + if (defaultReplySortIndex == 2) { + setting.put(SettingBoxKey.replySortType, 0); + defaultReplySortIndex = 0; + } + _sortType = ReplySortType.values[defaultReplySortIndex]; + sortTypeLabel = _sortType.labels.obs; + sortTypeTitle = _sortType.titles.obs; } // 请求动态内容