diff --git a/src/components/setting/SyncSettings.tsx b/src/components/setting/SyncSettings.tsx index 118d6dea..21f55722 100644 --- a/src/components/setting/SyncSettings.tsx +++ b/src/components/setting/SyncSettings.tsx @@ -122,7 +122,10 @@ export default () => { title={t('Sync.SyncCheck')} options={noxExtensionContent} onClose={() => setSyncCheckVisible(false)} - onSubmit={syncPartialNoxExtension} + onSubmit={i => { + syncPartialNoxExtension(i); + setSyncCheckVisible(false); + }} /> ); diff --git a/src/components/setting/sync/useSync.ts b/src/components/setting/sync/useSync.ts index acf3845a..bafe2648 100644 --- a/src/components/setting/sync/useSync.ts +++ b/src/components/setting/sync/useSync.ts @@ -72,7 +72,13 @@ const useSync = () => { const checkedPlaylists = checkedPlaylistIndexes .map((val, index) => val - ? cachedParsedContent[cachedParsedContent.MyFavList[index]] + ? { + ...cachedParsedContent[cachedParsedContent.MyFavList[index]], + songList: + cachedParsedContent[ + `${cachedParsedContent.MyFavList[index]}-songList` + ], + } : undefined, ) .filter(val => val); diff --git a/src/utils/ChromeStorage.ts b/src/utils/ChromeStorage.ts index 2ad57285..aab78365 100644 --- a/src/utils/ChromeStorage.ts +++ b/src/utils/ChromeStorage.ts @@ -251,9 +251,10 @@ const saveImportedPlaylist = async (playlists: any[]) => { export const clearPlaylistNImport = async (parsedContent: any) => { await clearPlaylists(); await saveImportedPlaylist( - parsedContent[StorageKeys.MY_FAV_LIST_KEY].map( - (val: string) => parsedContent[val], - ), + parsedContent[StorageKeys.MY_FAV_LIST_KEY].map((val: string) => ({ + ...parsedContent[val], + songList: parsedContent[`${val}-songList`], + })), ); await savePlaylistIds(parsedContent[StorageKeys.MY_FAV_LIST_KEY]); }; @@ -262,7 +263,7 @@ export const addImportedPlaylist = async (playlists: any[]) => { await saveImportedPlaylist(playlists); await savePlaylistIds( (await getItem(StorageKeys.MY_FAV_LIST_KEY)).concat( - playlists.map(val => val.info.id), + playlists.map(val => val.id), ), ); };