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); isEqualTo(entityId: record.id, entityType: record.entityType);
bool isEqualTo({EntityType entityType, String entityId}) => bool isEqualTo({EntityType entityType, String entityId}) =>
entityType == this.entityType && entityId == id; entityType == this.entityType && (entityId ?? '') == (id ?? '');
static Serializer<HistoryRecord> get serializer => _$historyRecordSerializer; static Serializer<HistoryRecord> get serializer => _$historyRecordSerializer;
} }

View File

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

View File

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