Skip to content

Commit

Permalink
cache filter
Browse files Browse the repository at this point in the history
  • Loading branch information
IoanaAlexandru committed Apr 14, 2020
1 parent 3e0a519 commit d5adf12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/pages/portal/view/portal_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ class _PortalPageState extends State<PortalPage> {
FilterProvider filterProvider = Provider.of<FilterProvider>(context);
AuthProvider authProvider = Provider.of<AuthProvider>(context);

filterFuture = filterProvider.fetchFilter(context);
if (filterFuture == null) {
filterFuture = filterProvider.fetchFilter(context);
}

List<Website> websites = [];

Expand Down Expand Up @@ -255,17 +257,20 @@ class _PortalPageState extends State<PortalPage> {
tooltip: S.of(context).navigationFilter,
items: {
S.of(context).filterMenuRelevance: () {
filterFuture = null; // reset filter cache
userOnly = false;
Navigator.pushNamed(context, Routes.filter);
},
S.of(context).filterMenuShowMine: () {
filterFuture = null; // reset filter cache
setState(() => userOnly = true);
filterProvider.enableFilter();
},
S.of(context).filterMenuShowAll: () {
if (!filterProvider.filterEnabled) {
AppToast.show(S.of(context).warningFilterAlreadyDisabled);
} else {
filterFuture = null; // reset filter cache
userOnly = false;
filterProvider.disableFilter();
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: A mobile application for students at ACS UPB.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.4.3+1
version: 0.4.4+1

environment:
sdk: ">=2.6.0 <3.0.0"
Expand Down

0 comments on commit d5adf12

Please sign in to comment.