Add preview stack
This commit is contained in:
parent
85cf6b43f5
commit
074945cf3d
|
|
@ -169,6 +169,8 @@ class PreviewEntity {
|
|||
final EntityType entityType;
|
||||
}
|
||||
|
||||
class ClearPreviewStack {}
|
||||
|
||||
class ClearData {}
|
||||
|
||||
class RefreshDataFailure implements StopLoading {
|
||||
|
|
@ -257,6 +259,10 @@ void viewEntitiesByType({
|
|||
store.dispatch(ClearEntityFilter());
|
||||
}
|
||||
|
||||
if (uiState.previewStack.isNotEmpty) {
|
||||
store.dispatch(ClearPreviewStack());
|
||||
}
|
||||
|
||||
switch (entityType) {
|
||||
case EntityType.dashboard:
|
||||
action = ViewDashboard(navigator: navigator);
|
||||
|
|
@ -382,6 +388,8 @@ void viewEntityById({
|
|||
entityType: entityType,
|
||||
));
|
||||
return;
|
||||
} else if (state.uiState.previewStack.isNotEmpty) {
|
||||
store.dispatch(ClearPreviewStack());
|
||||
}
|
||||
|
||||
if (filterEntity != null &&
|
||||
|
|
@ -598,6 +606,10 @@ void createEntityByType(
|
|||
context: context,
|
||||
force: force,
|
||||
callback: () {
|
||||
if (state.uiState.previewStack.isNotEmpty) {
|
||||
store.dispatch(ClearPreviewStack());
|
||||
}
|
||||
|
||||
switch (entityType) {
|
||||
case EntityType.client:
|
||||
store.dispatch(EditClient(
|
||||
|
|
@ -797,6 +809,10 @@ void createEntity({
|
|||
);
|
||||
}
|
||||
|
||||
if (uiState.previewStack.isNotEmpty) {
|
||||
store.dispatch(ClearPreviewStack());
|
||||
}
|
||||
|
||||
switch (entity.entityType) {
|
||||
case EntityType.client:
|
||||
store.dispatch(EditClient(
|
||||
|
|
|
|||
|
|
@ -294,4 +294,8 @@ Reducer<BuiltList<EntityType>> previewStackReducer = combineReducers([
|
|||
action.entityType
|
||||
]);
|
||||
}),
|
||||
TypedReducer<BuiltList<EntityType>, ClearPreviewStack>(
|
||||
(previewStack, action) {
|
||||
return BuiltList(<EntityType>[]);
|
||||
}),
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue