Skip to content

Commit c0340fa

Browse files
committed
🐞 fix: 修复格式错误
1 parent 6991557 commit c0340fa

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/utils/auth.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,16 @@ const setUserLikeDataLoop = async <T>(
330330
} catch (error) {
331331
console.error(`Error fetching ${key} data at offset ${offset}:`, error);
332332
break;
333-
if (key === "artists") {
334-
dataStore.setUserLikeData(key, allData as ArtistType[]);
335-
} else if (key === "playlists" || key === "albums" || key === "mvs" || key === "djs") {
336-
dataStore.setUserLikeData(key, allData as CoverType[]);
337-
} else {
338-
console.error(`Unsupported key in setUserLikeDataLoop: ${key}`);
339-
}
333+
}
334+
}
335+
// 保存数据
336+
if (key === "artists") {
337+
dataStore.setUserLikeData(key, allData as ArtistType[]);
338+
} else if (key === "playlists" || key === "albums" || key === "mvs" || key === "djs") {
339+
dataStore.setUserLikeData(key, allData as CoverType[]);
340+
} else {
341+
console.error(`Unsupported key in setUserLikeDataLoop: ${key}`);
342+
}
340343

341344
console.log(`✅ Fetched ${allData.length} ${key} for user ${userId}`);
342345
return allData;

0 commit comments

Comments
 (0)