j
This commit is contained in:
@@ -18,7 +18,7 @@ class LatestStoreOperationsCard extends StatelessWidget {
|
||||
// 1. Creiamo il Bloc e facciamo partire subito la query
|
||||
create: (context) =>
|
||||
LatestStoreOperationsBloc()
|
||||
..add(InitLastStoreOperationsEvent(currentStoreId ?? '')),
|
||||
..add(InitLatestStoreOperationsEvent(currentStoreId ?? '')),
|
||||
child: BlocListener<SessionCubit, SessionState>(
|
||||
// 2. MAGIA: Se l'utente cambia negozio dalla barra in alto, riavviamo lo stream!
|
||||
listenWhen: (previous, current) =>
|
||||
@@ -26,7 +26,7 @@ class LatestStoreOperationsCard extends StatelessWidget {
|
||||
listener: (context, state) {
|
||||
if (state.currentStore?.id != null) {
|
||||
context.read<LatestStoreOperationsBloc>().add(
|
||||
InitLastStoreOperationsEvent(state.currentStore!.id!),
|
||||
InitLatestStoreOperationsEvent(state.currentStore!.id!),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user