Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Sivan22/otzaria
Browse files Browse the repository at this point in the history
  • Loading branch information
Sivan22 committed Jan 13, 2025
2 parents 01a7032 + 3c3f24f commit 382b097
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
5 changes: 5 additions & 0 deletions lib/screens/library_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ class _LibraryBrowserState extends State<LibraryBrowser>
items: _getGridItems(currentTopCategory),
));
}
// Refocus the search bar after the grid is built.
// Doing it here, because the search bar is rebuilt every time the grid is rebuilt
Provider.of<AppModel>(context, listen: false)
.bookLocatorFocusNode
.requestFocus();

return items;
}
Expand Down
19 changes: 1 addition & 18 deletions lib/screens/reading/reading_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,7 @@ class _ReadingScreenState extends State<ReadingScreen>
return Consumer<AppModel>(
builder: (context, appModel, child) {
if (appModel.tabs.isEmpty) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Padding(
padding: EdgeInsets.all(8.0),
child: Center(child: Text('לא נבחרו ספרים')),
),
// a button to open the library browser
Center(
child: ElevatedButton(
onPressed: (() =>
appModel.currentView.value = Screens.library),
child: const Text('דפדוף בספריה'),
),
),
],
);
appModel.currentView.value = Screens.library;
}
return Builder(
builder: (context) {
Expand Down

0 comments on commit 382b097

Please sign in to comment.