1
0
mirror of https://gitlab.com/Cha_deL/peertubeify synced 2025-02-19 21:10:42 +01:00

Use type casting instead of Promise

This commit is contained in:
Booteille 2018-11-13 23:49:40 +01:00
parent 2614a3fc11
commit 2385b5f5c8
No known key found for this signature in database
GPG Key ID: 7FC1ED300B74CD91

View File

@ -68,12 +68,9 @@ const redirectPeertube = async (r) => {
if (prefs.redirectPeertube == RedirectType.Auto) {
const id = _.last(_.split('/', r.url));
const video = await searchByID(id);
const getHost = video => new Promise(async (resolve, reject) => {
resolve(video.account.host);
});
const video: any = await searchByID(id);
if (prefs.openInOriginalInstance && await getHost(video) === hostname) {
if (prefs.openInOriginalInstance && video.account.host === hostname) {
return {}; // Don't redirect if original instance
}