mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-24 02:18:50 +01:00
Respond to share folder changes
This commit is contained in:
parent
37a30e927c
commit
a04ecefed9
3 changed files with 26 additions and 0 deletions
|
@ -41,6 +41,7 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
|
|||
on<_SetMemoriesRange>(_onSetMemoriesRange);
|
||||
on<_SetEnableExif>(_onSetEnableExif);
|
||||
on<_UpdateDateTimeGroup>(_onUpdateDateTimeGroup);
|
||||
on<_SetShareFolder>(_onSetShareFolder);
|
||||
|
||||
on<_SetError>(_onSetError);
|
||||
|
||||
|
@ -57,6 +58,9 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
|
|||
_subscriptions.add(prefController.isEnableExif.listen((event) {
|
||||
add(_SetEnableExif(event));
|
||||
}));
|
||||
_subscriptions.add(accountPrefController.shareFolder.listen((event) {
|
||||
add(_SetShareFolder(event));
|
||||
}));
|
||||
|
||||
_nativeFileExifUpdatedListener?.begin();
|
||||
}
|
||||
|
@ -300,6 +304,11 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
|
|||
_transformItems(state.files);
|
||||
}
|
||||
|
||||
void _onSetShareFolder(_SetShareFolder ev, Emitter<_State> emit) {
|
||||
_log.info(ev);
|
||||
add(const _Reload());
|
||||
}
|
||||
|
||||
void _onSetError(_SetError ev, Emitter<_State> emit) {
|
||||
_log.info(ev);
|
||||
emit(state.copyWith(error: ExceptionEvent(ev.error, ev.stackTrace)));
|
||||
|
|
|
@ -248,6 +248,16 @@ class _SetEnableExif implements _Event {
|
|||
final bool value;
|
||||
}
|
||||
|
||||
@toString
|
||||
class _SetShareFolder implements _Event {
|
||||
const _SetShareFolder(this.value);
|
||||
|
||||
@override
|
||||
String toString() => _$toString();
|
||||
|
||||
final String value;
|
||||
}
|
||||
|
||||
@toString
|
||||
class _UpdateDateTimeGroup implements _Event {
|
||||
const _UpdateDateTimeGroup();
|
||||
|
|
|
@ -280,6 +280,13 @@ extension _$_SetEnableExifToString on _SetEnableExif {
|
|||
}
|
||||
}
|
||||
|
||||
extension _$_SetShareFolderToString on _SetShareFolder {
|
||||
String _$toString() {
|
||||
// ignore: unnecessary_string_interpolations
|
||||
return "_SetShareFolder {value: $value}";
|
||||
}
|
||||
}
|
||||
|
||||
extension _$_UpdateDateTimeGroupToString on _UpdateDateTimeGroup {
|
||||
String _$toString() {
|
||||
// ignore: unnecessary_string_interpolations
|
||||
|
|
Loading…
Reference in a new issue