Skip to content

Commit

Permalink
Merge pull request #72 from Spacelocust/fix/order-groups
Browse files Browse the repository at this point in the history
fix: groups order
  • Loading branch information
YummYume authored Jul 18, 2024
2 parents 7181453 + 631a1e3 commit 473e849
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 473e849

Please sign in to comment.