diff --git a/apps/mobile/src/features/social/Listening.tsx b/apps/mobile/src/features/social/Listening.tsx index e15f650..fee0947 100644 --- a/apps/mobile/src/features/social/Listening.tsx +++ b/apps/mobile/src/features/social/Listening.tsx @@ -38,7 +38,7 @@ export function ListenTogetherButton({ person }: { person: SocialPerson }) { function TogetherSheet({ person, close }: { person: SocialPerson; close: () => void }) { const { t } = useTranslation(); const { api, key } = useListening(); const cache = useQueryClient(); const state = usePlayerState(); const errorText = useErrorText(); const [kind, setKind] = useState<'join' | 'invite'>(person.activity ? 'join' : 'invite'); const [id] = useState(() => eventId(Date.now())); - const action = useMutation({ mutationFn: () => api.listeningAction({ id, action: kind, target_id: person.id }), onSuccess: async () => { await cache.invalidateQueries({ queryKey: key }); } }); + const action = useMutation({ mutationFn: () => api.listeningAction({ id, action: kind, target_id: person.id }), onSuccess: () => { close(); void cache.invalidateQueries({ queryKey: key }); } }); return