kopia lustrzana https://gitlab.com/mysocialportal/relatica
Cleanup TODOs
rodzic
02e713c577
commit
82c791bb21
|
@ -34,6 +34,9 @@ enum TimelineEntryFilterAction {
|
|||
}
|
||||
}
|
||||
|
||||
final emptyTimelineEntryFilter = TimelineEntryFilter.create(
|
||||
action: TimelineEntryFilterAction.warn, name: '', enabled: false);
|
||||
|
||||
class TimelineEntryFilter {
|
||||
final String id;
|
||||
final TimelineEntryFilterAction action;
|
||||
|
|
|
@ -83,7 +83,7 @@ Future<List<Connection>> myContacts(Ref ref, Profile profile) async {
|
|||
}
|
||||
|
||||
final _cbiLogger = Logger('ConnectionByIdProvider');
|
||||
//TODO May need to bootstrap RP with server call if by ID and doesn't know about it
|
||||
|
||||
@riverpod
|
||||
Result<Connection, ExecError> connectionById(
|
||||
Ref ref, Profile profile, String id,
|
||||
|
|
|
@ -69,8 +69,6 @@ class EntryTreeManager extends _$EntryTreeManager {
|
|||
@override
|
||||
Result<EntryTreeItem, ExecError> build(Profile profile, String id) {
|
||||
_etmLogger.finest('Building for $id for $profile');
|
||||
//TODO try using cache for instead of keep alive
|
||||
// ref.cacheFor(const Duration(hours: 1));
|
||||
entryId = id;
|
||||
final entries = ref.watch(_entryTreeItemsProvider(profile));
|
||||
final entry = entries[id];
|
||||
|
@ -100,7 +98,6 @@ class EntryTreeManager extends _$EntryTreeManager {
|
|||
|
||||
if (state.isFailure || entry != state.value) {
|
||||
state = Result.ok(entry);
|
||||
ref.invalidateSelf(); //TODO Confirm need to invalidate (I don't think I do any longer)
|
||||
}
|
||||
|
||||
return state;
|
||||
|
@ -180,7 +177,6 @@ class TimelineUpdater extends _$TimelineUpdater {
|
|||
.toList();
|
||||
if (entries.isNotEmpty) {
|
||||
_cleanupEntriesForId(id);
|
||||
//TODO confirm if ID may be wrong, have to think about if this always needs to be a post ID. Maybe this field is superfluous
|
||||
await _processNewItems(entries, profile.userId);
|
||||
}
|
||||
|
||||
|
@ -194,7 +190,6 @@ class TimelineUpdater extends _$TimelineUpdater {
|
|||
}
|
||||
|
||||
FutureResult<bool, ExecError> deleteEntryById(String id) async {
|
||||
// TODO fix tiemline is still showing deleted entries even after a refresh
|
||||
_tluLogger.finest('Delete entry: $id');
|
||||
final result = await ref
|
||||
.read(deleteStatusEntryByIdProvider(profile, id).future)
|
||||
|
@ -366,7 +361,6 @@ class StatusWriter extends _$StatusWriter {
|
|||
return true;
|
||||
}
|
||||
|
||||
// TODO move to RP timeline entry services
|
||||
FutureResult<TimelineEntry, ExecError> createNewStatus(
|
||||
Profile profile,
|
||||
String text, {
|
||||
|
|
|
@ -569,7 +569,7 @@ class _PostTreeEntryByIdProviderElement
|
|||
String get id => (origin as PostTreeEntryByIdProvider).id;
|
||||
}
|
||||
|
||||
String _$entryTreeManagerHash() => r'297419e4f1d6514f666676caf9dcb9db56df2e2f';
|
||||
String _$entryTreeManagerHash() => r'4550b72602c1fdd6977608930c259fec2ef622ed';
|
||||
|
||||
abstract class _$EntryTreeManager
|
||||
extends BuildlessNotifier<Result<EntryTreeItem, ExecError>> {
|
||||
|
|
|
@ -18,7 +18,6 @@ Map<String, TimelineEntry> _timelineEntries(Ref ref, Profile profile) => {};
|
|||
|
||||
final _logger = Logger('TimelineEntryManagerProvider');
|
||||
|
||||
//TODO Test using cacheFor to let it expire
|
||||
@Riverpod(keepAlive: true)
|
||||
class TimelineEntryManager extends _$TimelineEntryManager {
|
||||
var entryId = '';
|
||||
|
|
|
@ -44,7 +44,7 @@ class _FilterEditorScreenState extends ConsumerState<FilterEditorScreen> {
|
|||
final profile = ref.read(activeProfileProvider);
|
||||
final filter = ref
|
||||
.read(filterByIdProvider(profile, widget.id))
|
||||
.value; //TODO Handle error handling
|
||||
.getValueOrElse(() => emptyTimelineEntryFilter);
|
||||
nameController.text = filter.name;
|
||||
action = filter.action;
|
||||
for (final f in filter.authorFilters) {
|
||||
|
@ -69,7 +69,6 @@ class _FilterEditorScreenState extends ConsumerState<FilterEditorScreen> {
|
|||
Widget build(BuildContext context) {
|
||||
_logger.finest('Build for filter ${widget.id}');
|
||||
final profile = ref.watch(activeProfileProvider);
|
||||
//TODO streamline media queries
|
||||
final fieldWidth = MediaQuery.sizeOf(context).width * 0.8;
|
||||
|
||||
return Scaffold(
|
||||
|
|
|
@ -17,7 +17,6 @@ extension FlatteningExtensions on EntryTreeItem {
|
|||
required Ref ref}) {
|
||||
final items = <FlattenedTreeItem>[];
|
||||
|
||||
// TODO handle if entries aren't in manager
|
||||
final entryForItemResult =
|
||||
ref.read(timelineEntryManagerProvider(profile, id));
|
||||
if (entryForItemResult.isFailure) {
|
||||
|
|
Ładowanie…
Reference in New Issue