diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 668622c77c206..a428bcb383d88 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -28,6 +28,8 @@ /> diff --git a/src/renderer/components/playlist-info/playlist-info.js b/src/renderer/components/playlist-info/playlist-info.js index 7bab2971ac131..d5c9ca772cedd 100644 --- a/src/renderer/components/playlist-info/playlist-info.js +++ b/src/renderer/components/playlist-info/playlist-info.js @@ -109,8 +109,8 @@ export default defineComponent({ newTitle: '', newDescription: '', deletePlaylistPromptValues: [ - 'yes', - 'no' + 'delete', + 'cancel' ], } }, @@ -157,8 +157,8 @@ export default defineComponent({ deletePlaylistPromptNames: function () { return [ - this.$t('Yes'), - this.$t('No') + this.$t('Yes, Delete'), + this.$t('Cancel') ] }, @@ -326,56 +326,56 @@ export default defineComponent({ }, handleRemoveVideosOnWatchPromptAnswer: function (option) { - if (option === 'yes') { - const videosToWatch = this.selectedUserPlaylist.videos.filter((video) => { - return this.historyCacheById[video.videoId] == null - }) + this.showRemoveVideosOnWatchPrompt = false + if (option !== 'delete') { return } - const removedVideosCount = this.selectedUserPlaylist.videos.length - videosToWatch.length + const videosToWatch = this.selectedUserPlaylist.videos.filter((video) => { + return this.historyCacheById[video.videoId] == null + }) - if (removedVideosCount === 0) { - showToast(this.$t('User Playlists.SinglePlaylistView.Toast["There were no videos to remove."]')) - this.showRemoveVideosOnWatchPrompt = false - return - } + const removedVideosCount = this.selectedUserPlaylist.videos.length - videosToWatch.length - const playlist = { - playlistName: this.title, - protected: this.selectedUserPlaylist.protected, - description: this.description, - videos: videosToWatch, - _id: this.id - } - try { - this.updatePlaylist(playlist) - showToast(this.$tc('User Playlists.SinglePlaylistView.Toast.{videoCount} video(s) have been removed', removedVideosCount, { - videoCount: removedVideosCount, - })) - } catch (e) { - showToast(this.$t('User Playlists.SinglePlaylistView.Toast["There was an issue with updating this playlist."]')) - console.error(e) - } + if (removedVideosCount === 0) { + showToast(this.$t('User Playlists.SinglePlaylistView.Toast["There were no videos to remove."]')) + this.showRemoveVideosOnWatchPrompt = false + return + } + + const playlist = { + playlistName: this.title, + protected: this.selectedUserPlaylist.protected, + description: this.description, + videos: videosToWatch, + _id: this.id + } + try { + this.updatePlaylist(playlist) + showToast(this.$tc('User Playlists.SinglePlaylistView.Toast.{videoCount} video(s) have been removed', removedVideosCount, { + videoCount: removedVideosCount, + })) + } catch (e) { + showToast(this.$t('User Playlists.SinglePlaylistView.Toast["There was an issue with updating this playlist."]')) + console.error(e) } - this.showRemoveVideosOnWatchPrompt = false }, handleDeletePlaylistPromptAnswer: function (option) { - if (option === 'yes') { - if (this.selectedUserPlaylist.protected) { - showToast(this.$t('User Playlists.SinglePlaylistView.Toast["This playlist is protected and cannot be removed."]')) - } else { - this.removePlaylist(this.id) - this.$router.push( - { - path: '/userPlaylists' - } - ) - showToast(this.$t('User Playlists.SinglePlaylistView.Toast["Playlist {playlistName} has been deleted."]', { - playlistName: this.title, - })) - } - } this.showDeletePlaylistPrompt = false + if (option !== 'delete') { return } + + if (this.selectedUserPlaylist.protected) { + showToast(this.$t('User Playlists.SinglePlaylistView.Toast["This playlist is protected and cannot be removed."]')) + } else { + this.removePlaylist(this.id) + this.$router.push( + { + path: '/userPlaylists' + } + ) + showToast(this.$t('User Playlists.SinglePlaylistView.Toast["Playlist {playlistName} has been deleted."]', { + playlistName: this.title, + })) + } }, enableQuickBookmarkForThisPlaylist() { diff --git a/src/renderer/components/privacy-settings/privacy-settings.js b/src/renderer/components/privacy-settings/privacy-settings.js index c547dfb4e9e7f..98b9a266ced9d 100644 --- a/src/renderer/components/privacy-settings/privacy-settings.js +++ b/src/renderer/components/privacy-settings/privacy-settings.js @@ -57,10 +57,10 @@ export default defineComponent({ handleSearchCache: function (option) { this.showSearchCachePrompt = false - if (option === 'delete') { - this.clearSessionSearchHistory() - showToast(this.$t('Settings.Privacy Settings.Search cache has been cleared')) - } + if (option !== 'delete') { return } + + this.clearSessionSearchHistory() + showToast(this.$t('Settings.Privacy Settings.Search cache has been cleared')) }, handleRememberHistory: function (value) { @@ -74,10 +74,10 @@ export default defineComponent({ handleRemoveHistory: function (option) { this.showRemoveHistoryPrompt = false - if (option === 'delete') { - this.removeAllHistory() - showToast(this.$t('Settings.Privacy Settings.Watch history has been cleared')) - } + if (option !== 'delete') { return } + + this.removeAllHistory() + showToast(this.$t('Settings.Privacy Settings.Watch history has been cleared')) }, handleRemoveSubscriptions: function (option) { @@ -107,7 +107,8 @@ export default defineComponent({ handleRemovePlaylists: function (option) { this.showRemovePlaylistsPrompt = false - if (option !== 'yes') { return } + + if (option !== 'delete') { return } this.removeAllPlaylists() this.updateQuickBookmarkTargetPlaylistId('favorites')