Cancel button for client settings doesn't work #494
This commit is contained in:
parent
51f02b9cd7
commit
22eb7d4782
|
|
@ -551,6 +551,9 @@ Reducer<BuiltList<HistoryRecord>> historyReducer = combineReducers([
|
|||
TypedReducer<BuiltList<HistoryRecord>, ViewClient>((historyList, action) =>
|
||||
_addToHistory(historyList,
|
||||
HistoryRecord(id: action.clientId, entityType: EntityType.client))),
|
||||
TypedReducer<BuiltList<HistoryRecord>, ViewClientList>((historyList,
|
||||
action) =>
|
||||
_addToHistory(historyList, HistoryRecord(entityType: EntityType.client))),
|
||||
TypedReducer<BuiltList<HistoryRecord>, EditClient>((historyList, action) =>
|
||||
_addToHistory(historyList,
|
||||
HistoryRecord(id: action.client.id, entityType: EntityType.client))),
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
|||
style: Theme.of(context).textTheme.bodySmall,
|
||||
);
|
||||
}
|
||||
} else if (history.id == null) {
|
||||
title = Text(localization.lookup(history.entityType.plural));
|
||||
} else {
|
||||
entity = state.getEntityMap(history.entityType)[history.id] as BaseEntity;
|
||||
|
||||
|
|
@ -241,10 +243,14 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
|||
));
|
||||
break;
|
||||
default:
|
||||
viewEntityById(
|
||||
entityId: history.id,
|
||||
entityType: history.entityType,
|
||||
);
|
||||
if (history.id == null) {
|
||||
viewEntitiesByType(entityType: history.entityType);
|
||||
} else {
|
||||
viewEntityById(
|
||||
entityId: history.id,
|
||||
entityType: history.entityType,
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
onLongPress: entity == null
|
||||
|
|
|
|||
|
|
@ -274,11 +274,9 @@ class MainScreen extends StatelessWidget {
|
|||
].contains(item.entityType)) {
|
||||
history = item;
|
||||
break;
|
||||
} else if (item.id == null) {
|
||||
history = item;
|
||||
} else {
|
||||
if (item.id == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final entity =
|
||||
state.getEntityMap(item.entityType)[item.id] as BaseEntity;
|
||||
if (entity == null || !entity.isActive) {
|
||||
|
|
@ -314,11 +312,15 @@ class MainScreen extends StatelessWidget {
|
|||
));
|
||||
break;
|
||||
default:
|
||||
viewEntityById(
|
||||
entityId: history.id,
|
||||
entityType: history.entityType,
|
||||
showError: false,
|
||||
);
|
||||
if (history.id == null) {
|
||||
viewEntitiesByType(entityType: history.entityType);
|
||||
} else {
|
||||
viewEntityById(
|
||||
entityId: history.id,
|
||||
entityType: history.entityType,
|
||||
showError: false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -132,11 +132,16 @@ class _MenuDrawerState extends State<MenuDrawer> {
|
|||
));
|
||||
break;
|
||||
default:
|
||||
viewEntityById(
|
||||
entityId: history.id,
|
||||
entityType: history.entityType,
|
||||
showError: false,
|
||||
);
|
||||
if (history.id == null) {
|
||||
viewEntitiesByType(
|
||||
entityType: history.entityType);
|
||||
} else {
|
||||
viewEntityById(
|
||||
entityId: history.id,
|
||||
entityType: history.entityType,
|
||||
showError: false,
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
icon: Icon(MdiIcons.arrowLeftCircleOutline))
|
||||
|
|
|
|||
Loading…
Reference in New Issue