From 4dc6d0aaace1aa968bf14ae1c637f7cceadbd01b Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 15 Jun 2022 09:22:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AD=8C=E6=9B=B2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9B=B4=E6=96=B0=E6=93=8D=E4=BD=9C=E7=9A=84=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/lang/en_us.json | 1 + src/lang/zh_cn.json | 1 + src/screens/Home/List/components/MyList.js | 8 +++++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index d9813f9..722f6b4 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -6,6 +6,7 @@ ### 优化 - 支持mg源的歌词翻译(之前添加的歌曲需要去设置清空缓存才会刷新歌词) +- 添加歌曲列表更新操作的二次确认 ### 修复 diff --git a/src/lang/en_us.json b/src/lang/en_us.json index 2b4fd89..e4f7b68 100644 --- a/src/lang/en_us.json +++ b/src/lang/en_us.json @@ -67,6 +67,7 @@ "list_select_single": "Single Select", "list_select_unall": "Reverse Selection", "list_sync": "Update", + "list_sync_confirm_tip": "This will replace the songs in {{name}} with the songs in the online list, are you sure you want to update?", "list_update_error": "Update failed", "list_update_success": "Update completed", "load_failed": "Ah, loading failed 😥", diff --git a/src/lang/zh_cn.json b/src/lang/zh_cn.json index 62c4a7d..5dd6133 100644 --- a/src/lang/zh_cn.json +++ b/src/lang/zh_cn.json @@ -68,6 +68,7 @@ "list_select_single": "单选", "list_select_unall": "反选", "list_sync": "更新", + "list_sync_confirm_tip": "这将会把 {{name}} 内的歌曲替换成在线列表的歌曲,你确认要更新吗?", "list_update_error": "更新失败", "list_update_success": "更新成功", "load_failed": "啊 加载失败了 😥", diff --git a/src/screens/Home/List/components/MyList.js b/src/screens/Home/List/components/MyList.js index 6956a82..e6a0674 100644 --- a/src/screens/Home/List/components/MyList.js +++ b/src/screens/Home/List/components/MyList.js @@ -261,7 +261,13 @@ const List = memo(({ setVisiblePanel, currentList, handleCancelMultiSelect }) => handleImportAndExportList('export', selectedListRef.current.index) break case 'sync': - handleSyncSourceList(selectedListRef.current.index) + confirmDialog({ + message: t('list_sync_confirm_tip', { name: selectedListRef.current.name }), + confirmButtonText: t('list_remove_tip_button'), + }).then(isSync => { + if (!isSync) return + handleSyncSourceList(selectedListRef.current.index) + }) break // case 'changePosition':