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 {
|
onPressed: () async {
|
||||||
if (playlistName.text.isEmpty) return;
|
if (playlistName.text.isEmpty) return;
|
||||||
final me = await spotify.me.get();
|
final me = await spotify.me.get();
|
||||||
await spotify.playlists
|
await spotify.playlists.createPlaylist(
|
||||||
.createPlaylist(
|
|
||||||
me.id!,
|
me.id!,
|
||||||
playlistName.text,
|
playlistName.text,
|
||||||
collaborative: collaborative.value,
|
collaborative: collaborative.value,
|
||||||
public: public.value,
|
public: public.value,
|
||||||
description: description.text,
|
description: description.text,
|
||||||
)
|
);
|
||||||
.then((_) {
|
await QueryBowl.of(context)
|
||||||
QueryBowl.of(context).refetchQueries([
|
.getQuery(
|
||||||
Queries.playlist.ofMine.queryKey,
|
Queries.playlist.ofMine.queryKey,
|
||||||
]);
|
)
|
||||||
Navigator.pop(context);
|
?.refetch();
|
||||||
});
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@ -165,9 +165,9 @@ class PlaylistHeartButton extends HookConsumerWidget {
|
|||||||
|
|
||||||
final togglePlaylistLike = useMutation<bool, Tuple2<SpotifyApi, bool>>(
|
final togglePlaylistLike = useMutation<bool, Tuple2<SpotifyApi, bool>>(
|
||||||
job: Mutations.playlist.toggleFavorite(playlist.id!),
|
job: Mutations.playlist.toggleFavorite(playlist.id!),
|
||||||
onData: (payload, variables, queryContext) {
|
onData: (payload, variables, queryContext) async {
|
||||||
isLikedQuery.refetch();
|
await isLikedQuery.refetch();
|
||||||
QueryBowl.of(context)
|
await QueryBowl.of(context)
|
||||||
.getQuery(Queries.playlist.ofMine.queryKey)
|
.getQuery(Queries.playlist.ofMine.queryKey)
|
||||||
?.refetch();
|
?.refetch();
|
||||||
},
|
},
|
||||||
|
@ -306,7 +306,7 @@ class TrackTile extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
if (userPlaylist && auth.isLoggedIn)
|
if (userPlaylist && auth.isLoggedIn)
|
||||||
Action(
|
Action(
|
||||||
icon: removeTrack.isLoading &&
|
icon: (removeTrack.isLoading || !removeTrack.hasData) &&
|
||||||
removingTrack.value == track.value.uri
|
removingTrack.value == track.value.uri
|
||||||
? const Center(
|
? const Center(
|
||||||
child: PlatformCircularProgressIndicator(),
|
child: PlatformCircularProgressIndicator(),
|
||||||
|
@ -157,6 +157,13 @@ class ArtistPage extends HookConsumerWidget {
|
|||||||
FollowingType.artist,
|
FollowingType.artist,
|
||||||
[artistId],
|
[artistId],
|
||||||
);
|
);
|
||||||
|
await isFollowingQuery.refetch();
|
||||||
|
QueryBowl.of(context)
|
||||||
|
.getInfiniteQuery(
|
||||||
|
Queries.artist.followedByMe
|
||||||
|
.queryKey,
|
||||||
|
)
|
||||||
|
?.refetch();
|
||||||
} catch (e, stack) {
|
} catch (e, stack) {
|
||||||
logger.e(
|
logger.e(
|
||||||
"FollowButton.onPressed",
|
"FollowButton.onPressed",
|
||||||
|
Loading…
Reference in New Issue
Block a user