mirror of https://github.com/FreeTubeApp/FreeTube
Remove toast from showing up when grabbing legacy video data
This commit is contained in:
parent
48436e50b3
commit
ee25f31938
|
@ -58,11 +58,13 @@ function addToHistory(data){
|
|||
*
|
||||
* @return {Void}
|
||||
*/
|
||||
function removeFromHistory(videoId){
|
||||
function removeFromHistory(videoId, toast = true){
|
||||
const data = {videoId: videoId};
|
||||
historyDb.remove(data, {}, (err, numRemoved) => {
|
||||
if (!err) {
|
||||
showToast('Video removed from history');
|
||||
if (toast) {
|
||||
if (!err) {
|
||||
showToast('Video removed from history');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -106,7 +108,7 @@ function showHistory(){
|
|||
videoData.position = index;
|
||||
displayVideo(videoData, 'history');
|
||||
}, () => {
|
||||
removeFromHistory(video.videoId);
|
||||
removeFromHistory(video.videoId, false);
|
||||
});
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -70,11 +70,13 @@ function addSavedVideo(videoId) {
|
|||
*
|
||||
* @return {Void}
|
||||
*/
|
||||
function removeSavedVideo(videoId, string) {
|
||||
function removeSavedVideo(videoId, toast = true) {
|
||||
savedVidsDb.remove({
|
||||
videoId: videoId
|
||||
}, {}, (err, numRemoved) => {
|
||||
showToast('Video has been removed from the favorites list.');
|
||||
if (toast) {
|
||||
showToast('Video has been removed from the favorites list.');
|
||||
}
|
||||
if (savedView.seen === true) {
|
||||
showSavedVideos();
|
||||
}
|
||||
|
@ -169,7 +171,7 @@ function showSavedVideos() {
|
|||
videoData.position = index;
|
||||
displayVideo(videoData, 'saved');
|
||||
}, () => {
|
||||
removeSavedVideo(video.videoId);
|
||||
removeSavedVideo(video.videoId, false);
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue