Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: always return savedVideo if found

Christian Feiab45e35a9b68
diff --git a/lib/repository.js b/lib/repository.js
index 7f8cd4b..acb6ecc 100644
--- a/lib/repository.js
+++ b/lib/repository.js
@@ -211,7 +211,8 @@ export default class Repository {
}
patchVideo (video) {
- if (this.getVideo(video.id)) return video
+ const savedVideo = this.getVideo(video.id)
+ if (savedVideo) return savedVideo
return Object.assign(video, { addedAt: Date.now() })
}