🐛 Bug fixes
This commit is contained in:
parent
06b4cb863e
commit
41f456893f
@ -47,11 +47,12 @@ class _ExploreScreenState extends State<ExploreScreen> {
|
||||
if (res.statusCode == 200) {
|
||||
final result =
|
||||
PaginationResult.fromJson(jsonDecode(utf8.decode(res.bodyBytes)));
|
||||
final isLastPage = (result.data?.length ?? 0) < pageSize;
|
||||
if (isLastPage) {
|
||||
final isLastPage = (result.count - pageKey) < pageSize;
|
||||
if (isLastPage || result.data == null) {
|
||||
paginationController.appendLastPage(feed);
|
||||
} else {
|
||||
final feed = result.data!.map((x) => Feed.fromJson(x)).toList();
|
||||
final feed =
|
||||
result.data?.map((x) => Feed.fromJson(x)).toList() ?? List.empty();
|
||||
final nextPageKey = pageKey + feed.length;
|
||||
paginationController.appendPage(feed, nextPageKey);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class _MomentEditorScreenState extends State<MomentEditorScreen> {
|
||||
bool showRecommendationBanner = true;
|
||||
|
||||
Future<void> postMoment() async {
|
||||
if (authClient.client == null) return;
|
||||
if (!await authClient.isAuthorized()) return;
|
||||
|
||||
setState(() => isSubmitting = true);
|
||||
var res = await authClient.client!.post(
|
||||
|
Reference in New Issue
Block a user