Fix for back button

This commit is contained in:
Hillel Coren 2023-06-06 15:23:46 +03:00
parent 08df377ddb
commit 530091c37b
3 changed files with 5 additions and 3 deletions

View File

@ -421,7 +421,7 @@ abstract class HistoryRecord
isEqualTo(entityId: record.id, entityType: record.entityType);
bool isEqualTo({EntityType entityType, String entityId}) =>
entityType == this.entityType && entityId == id;
entityType == this.entityType && (entityId ?? '') == (id ?? '');
static Serializer<HistoryRecord> get serializer => _$historyRecordSerializer;
}

View File

@ -308,11 +308,12 @@ class MainScreen extends StatelessWidget {
store.dispatch(ViewSettings(
section: history.id,
company: state.company,
user: state.user,
tabIndex: 0,
));
break;
default:
if (history.id == null) {
if ((history.id ?? '').isEmpty) {
viewEntitiesByType(entityType: history.entityType);
} else {
viewEntityById(

View File

@ -128,11 +128,12 @@ class _MenuDrawerState extends State<MenuDrawer> {
store.dispatch(ViewSettings(
section: history.id,
company: state.company,
user: state.user,
tabIndex: 0,
));
break;
default:
if (history.id == null) {
if ((history.id ?? '').isEmpty) {
viewEntitiesByType(
entityType: history.entityType);
} else {