merge-requests/67/merge
Hank Grabowski 2024-12-19 21:30:14 -05:00
rodzic 02e713c577
commit 82c791bb21
7 zmienionych plików z 6 dodań i 12 usunięć

Wyświetl plik

@ -34,6 +34,9 @@ enum TimelineEntryFilterAction {
}
}
final emptyTimelineEntryFilter = TimelineEntryFilter.create(
action: TimelineEntryFilterAction.warn, name: '', enabled: false);
class TimelineEntryFilter {
final String id;
final TimelineEntryFilterAction action;

Wyświetl plik

@ -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,

Wyświetl plik

@ -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, {

Wyświetl plik

@ -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>> {

Wyświetl plik

@ -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 = '';

Wyświetl plik

@ -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(

Wyświetl plik

@ -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) {