kopia lustrzana https://gitlab.com/mysocialportal/relatica
Fix deleting comment causes empty screen bug
rodzic
799d877b20
commit
ed41a97db0
|
@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:relatica/utils/snackbar_builder.dart';
|
||||
import 'package:result_monad/result_monad.dart';
|
||||
|
||||
import '../../globals.dart';
|
||||
import '../../models/filters/timeline_entry_filter.dart';
|
||||
|
@ -316,11 +318,21 @@ class _StatusControlState extends State<FlattenedTreeEntryControl> {
|
|||
if (confirm == true) {
|
||||
await getIt<ActiveProfileSelector<TimelineManager>>()
|
||||
.activeEntry
|
||||
.andThenAsync(
|
||||
(tm) async => await tm.deleteEntryById(item.timelineEntry.id));
|
||||
.transformAsync(
|
||||
(tm) async => await tm.deleteEntryById(item.timelineEntry.id))
|
||||
.match(onSuccess: (_) {
|
||||
isProcessing = false;
|
||||
if (!isPost && context.canPop()) {
|
||||
context.pop();
|
||||
}
|
||||
}, onError: (e) {
|
||||
isProcessing = false;
|
||||
buildSnackbar(
|
||||
context,
|
||||
'Error deleting ${isPost ? "Post" : "Comment"}: $e',
|
||||
);
|
||||
});
|
||||
}
|
||||
setState(() {
|
||||
isProcessing = false;
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue