Pop preview when clicking back

This commit is contained in:
Hillel Coren 2020-12-10 20:49:00 +02:00
parent 4a8b4c19e3
commit f813cb5b6e
2 changed files with 7 additions and 0 deletions

View File

@ -198,4 +198,6 @@ abstract class UIState implements Built<UIState, UIStateBuilder> {
bool get isViewing => !isEditing && !isEmailing;
bool get isInSettings => currentRoute.contains('settings');
bool get isPreviewing => previewStack.isNotEmpty;
}

View File

@ -247,6 +247,11 @@ class MainScreen extends StatelessWidget {
final index = isEditing ? 0 : 1;
HistoryRecord history;
if (state.uiState.isPreviewing) {
store.dispatch(PopPreviewStack());
return false;
}
for (int i = index; i < historyList.length; i++) {
final item = historyList[i];
if ([