mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-14 16:25:16 +00:00
fix: user playlists not updating after creating/deleting, artist follow not updating after follow/unfollow
This commit is contained in:
parent
42d284f8d8
commit
6cc2a185d0
@ -34,20 +34,19 @@ class PlaylistCreateDialog extends HookConsumerWidget {
|
||||
onPressed: () async {
|
||||
if (playlistName.text.isEmpty) return;
|
||||
final me = await spotify.me.get();
|
||||
await spotify.playlists
|
||||
.createPlaylist(
|
||||
await spotify.playlists.createPlaylist(
|
||||
me.id!,
|
||||
playlistName.text,
|
||||
collaborative: collaborative.value,
|
||||
public: public.value,
|
||||
description: description.text,
|
||||
)
|
||||
.then((_) {
|
||||
QueryBowl.of(context).refetchQueries([
|
||||
);
|
||||
await QueryBowl.of(context)
|
||||
.getQuery(
|
||||
Queries.playlist.ofMine.queryKey,
|
||||
]);
|
||||
)
|
||||
?.refetch();
|
||||
Navigator.pop(context);
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
|
@ -165,9 +165,9 @@ class PlaylistHeartButton extends HookConsumerWidget {
|
||||
|
||||
final togglePlaylistLike = useMutation<bool, Tuple2<SpotifyApi, bool>>(
|
||||
job: Mutations.playlist.toggleFavorite(playlist.id!),
|
||||
onData: (payload, variables, queryContext) {
|
||||
isLikedQuery.refetch();
|
||||
QueryBowl.of(context)
|
||||
onData: (payload, variables, queryContext) async {
|
||||
await isLikedQuery.refetch();
|
||||
await QueryBowl.of(context)
|
||||
.getQuery(Queries.playlist.ofMine.queryKey)
|
||||
?.refetch();
|
||||
},
|
||||
|
@ -306,7 +306,7 @@ class TrackTile extends HookConsumerWidget {
|
||||
),
|
||||
if (userPlaylist && auth.isLoggedIn)
|
||||
Action(
|
||||
icon: removeTrack.isLoading &&
|
||||
icon: (removeTrack.isLoading || !removeTrack.hasData) &&
|
||||
removingTrack.value == track.value.uri
|
||||
? const Center(
|
||||
child: PlatformCircularProgressIndicator(),
|
||||
|
@ -157,6 +157,13 @@ class ArtistPage extends HookConsumerWidget {
|
||||
FollowingType.artist,
|
||||
[artistId],
|
||||
);
|
||||
await isFollowingQuery.refetch();
|
||||
QueryBowl.of(context)
|
||||
.getInfiniteQuery(
|
||||
Queries.artist.followedByMe
|
||||
.queryKey,
|
||||
)
|
||||
?.refetch();
|
||||
} catch (e, stack) {
|
||||
logger.e(
|
||||
"FollowButton.onPressed",
|
||||
|
Loading…
Reference in New Issue
Block a user