同步时会下载音乐
This commit is contained in:
@@ -851,9 +851,10 @@
|
||||
|
||||
const handleSync = async () => {
|
||||
if (!syncToken) return;
|
||||
|
||||
// Sync Favorites
|
||||
const cloudFavorites = await syncService.get('favorites', syncToken);
|
||||
if (cloudFavorites && Array.isArray(cloudFavorites)) {
|
||||
// Merge strategy: Combine unique songs by ID
|
||||
setFavorites(prev => {
|
||||
const combined = [...prev];
|
||||
cloudFavorites.forEach(cloudSong => {
|
||||
@@ -864,6 +865,11 @@
|
||||
return combined;
|
||||
});
|
||||
}
|
||||
|
||||
// Also push current favorites to cloud to ensure sync
|
||||
if (favorites.length > 0) {
|
||||
syncService.set('favorites', favorites, syncToken);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user