File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,14 @@ class UserSuggestions
5353 }
5454 }
5555
56+ public function clear_cache (): void
57+ {
58+ // only clear the cache for the user looking at their own suggestions
59+ if ($ this ->_username == User::current_username ()) {
60+ unset($ _SESSION [$ this ->_cache_key ]);
61+ }
62+ }
63+
5664 private function _calculate_normalized_weights (array $ criteria ): array
5765 {
5866 $ new_criteria = [];
Original file line number Diff line number Diff line change 7979}
8080if (count ($ projects ) == 0 ) {
8181 echo "<p> " . $ round_view_options [$ round_view ]["text_none " ] . "</p> " ;
82+
83+ // clear the suggestions cache so if they get access to rounds and come
84+ // back to the page, we re-evaluate their suggestions
85+ $ user_suggestions ->clear_cache ();
8286} else {
8387 if ($ explain_why ) {
8488 // we don't html_safe() as they can contain HTML
You can’t perform that action at this time.
0 commit comments