mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 09:16:19 +01:00
Only reacts to events of the same account
This commit is contained in:
parent
f9ae813613
commit
4ef2431c83
1 changed files with 10 additions and 5 deletions
|
@ -201,12 +201,14 @@ class ListSharingBloc extends Bloc<ListSharingBlocEvent, ListSharingBlocState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onShareRemovedEvent(ShareRemovedEvent ev) {
|
void _onShareRemovedEvent(ShareRemovedEvent ev) {
|
||||||
|
if (_isAccountOfInterest(ev.account)) {
|
||||||
_refreshThrottler.trigger(
|
_refreshThrottler.trigger(
|
||||||
maxResponceTime: const Duration(seconds: 3),
|
maxResponceTime: const Duration(seconds: 3),
|
||||||
maxPendingCount: 10,
|
maxPendingCount: 10,
|
||||||
data: ev.share,
|
data: ev.share,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<List<ListSharingItem>> _query(ListSharingBlocQuery ev) async {
|
Future<List<ListSharingItem>> _query(ListSharingBlocQuery ev) async {
|
||||||
final fileRepo = FileRepo(FileCachedDataSource(AppDb()));
|
final fileRepo = FileRepo(FileCachedDataSource(AppDb()));
|
||||||
|
@ -342,6 +344,9 @@ class ListSharingBloc extends Bloc<ListSharingBlocEvent, ListSharingBlocState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _isAccountOfInterest(Account account) =>
|
||||||
|
state.account == null || state.account!.compareServerIdentity(account);
|
||||||
|
|
||||||
late final _shareRemovedListener =
|
late final _shareRemovedListener =
|
||||||
AppEventListener<ShareRemovedEvent>(_onShareRemovedEvent);
|
AppEventListener<ShareRemovedEvent>(_onShareRemovedEvent);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue