-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created Undo Button On Toast After Removing Video From Playlist. #5845
Conversation
Please undo your changes to yarn.lock and remove package-lock.json |
@@ -107,7 +107,7 @@ | |||
:initial-visible-state="index < 10" | |||
@move-video-up="moveVideoUp(item.videoId, item.playlistItemId)" | |||
@move-video-down="moveVideoDown(item.videoId, item.playlistItemId)" | |||
@remove-from-playlist="removeVideoFromPlaylist(item.videoId, item.playlistItemId)" | |||
@remove-from-playlist="removeVideoFromPlaylist(item.videoId)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can pass item here so you dont need to find the video in the remove function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
item.playlistItemId is giving null value
showToast(this.$t('User Playlists.SinglePlaylistView.Toast.Video has been removed'), 3000, () => { | ||
this.addVideoBackToPlaylist(videoData); | ||
}, | ||
'Undo' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need to be translated. I think we might already have a translation key for this so it'd just be
'Undo' | |
this.$t('Undo') |
}); | ||
// Update playlist's `lastUpdatedAt` | ||
this.updatePlaylist({ _id: this.playlistId }); | ||
showToast('Video has been added back to playlist', 3000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be translated
this.updatePlaylist({ _id: this.playlistId }); | ||
showToast('Video has been added back to playlist', 3000); | ||
} catch (e) { | ||
showToast('There was a problem with adding this video back to playlist'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be translated
@@ -7,13 +7,18 @@ | |||
:class="{ closed: !toast.isOpen, open: toast.isOpen }" | |||
tabindex="0" | |||
role="status" | |||
@click="performAction(toast.id)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe removing this will break the ability to copy error messages for error toasts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request is way too over-engineered and as ChunkyProgrammer mentioned, this breaks lots of existing functionality (copying errors, undoing the change of the quick bookmark playlist, etc etc).
Please implement the undo in the same way that it is done for the quick bookmark feature (just changing the text and adding a action function that undoes the change): https://github.com/FreeTubeApp/FreeTube/blob/development/src/renderer/components/playlist-info/playlist-info.js#L515-L529
Head branch was pushed to by a user without write access
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
hey , can you help ? how should i resolve this conflict in yarn.lock file? |
Remove all changes that you made to it, as this pull request doesn't change any dependencies it should not include any modifications to the yarn.lock file. |
Head branch was pushed to by a user without write access
Pull request was closed
Pull Request Type
Related issue
"closes #5421"
Description
This pr is a new feature which gives an 'undo' option for user to add removed video back to playlist within 3 seconds of removal , just incase it is accidently removed.
Additional context
This is my first ever pull request please let me know if anything is wrong or can be improved.