Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: groups order #72

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/internal/server/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ func (s *Server) GetGroups(c *gin.Context) {
Preload("GroupUsers.User").
Preload("GroupUsers.GroupUserMissions.Stratagems").
Preload("Planet").
Order("start_at desc").
Where("start_at > ?", time.Now()).
Find(&groups, "public = ?", true).Error

if err != nil {
Expand All @@ -169,13 +171,14 @@ func (s *Server) GetGroups(c *gin.Context) {
// Get groups that the user is a member of and public groups
err := db.
Joins("LEFT JOIN group_users ON groups.id = group_users.group_id").
Where("group_users.user_id = ? OR groups.public = ?", user.ID, true).
Where("group_users.user_id = ? OR groups.public = ? AND groups.start_at > ?", user.ID, true, time.Now()).
Preload("Missions.GroupUserMissions.Stratagems").
Preload("Missions.GroupUserMissions.GroupUser.User").
Preload("GroupUsers.User").
Preload("GroupUsers.GroupUserMissions.Stratagems").
Preload("Planet").
Distinct(GroupFieldsDistinct).
Order("groups.start_at desc").
Find(&groups).Error

if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions mobile/lib/services/local_notification_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ abstract class LocalNotificationService {
rootNavigatorKey.currentContext,
notificationResponse,
),
onDidReceiveBackgroundNotificationResponse: (notificationResponse) =>
onDidReceiveNotificationResponse(
rootNavigatorKey.currentContext,
notificationResponse,
),
);

final platform =
Expand Down
Loading