mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-06 01:57:45 +08:00
refa: query data (#659)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:PiliPlus/pages/fav/article/view.dart';
|
||||
import 'package:PiliPlus/pages/fav/note/view.dart';
|
||||
import 'package:PiliPlus/pages/fav/pgc/view.dart';
|
||||
@@ -54,13 +55,13 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
||||
Get.toNamed('/createFav')?.then(
|
||||
(data) {
|
||||
if (data != null) {
|
||||
List list = _favController.loadingState.value is Success
|
||||
? (_favController.loadingState.value as Success)
|
||||
.response
|
||||
: [];
|
||||
List<FavFolderItemData> list =
|
||||
_favController.loadingState.value is Success
|
||||
? (_favController.loadingState.value as Success)
|
||||
.response
|
||||
: <FavFolderItemData>[];
|
||||
list.insert(list.isNotEmpty ? 1 : 0, data);
|
||||
_favController.loadingState.value =
|
||||
LoadingState.success(list);
|
||||
_favController.loadingState.refresh();
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -81,6 +82,7 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
||||
'title': item.title,
|
||||
'count': item.mediaCount,
|
||||
'searchType': SearchType.fav,
|
||||
'isOwner': true,
|
||||
});
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user