mirror of
https://gitlab.com/Cha_deL/peertubeify
synced 2025-02-21 05:51:15 +01:00
Use type casting instead of Promise
This commit is contained in:
parent
2614a3fc11
commit
2385b5f5c8
@ -68,12 +68,9 @@ const redirectPeertube = async (r) => {
|
|||||||
|
|
||||||
if (prefs.redirectPeertube == RedirectType.Auto) {
|
if (prefs.redirectPeertube == RedirectType.Auto) {
|
||||||
const id = _.last(_.split('/', r.url));
|
const id = _.last(_.split('/', r.url));
|
||||||
const video = await searchByID(id);
|
const video: any = await searchByID(id);
|
||||||
const getHost = video => new Promise(async (resolve, reject) => {
|
|
||||||
resolve(video.account.host);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (prefs.openInOriginalInstance && await getHost(video) === hostname) {
|
if (prefs.openInOriginalInstance && video.account.host === hostname) {
|
||||||
return {}; // Don't redirect if original instance
|
return {}; // Don't redirect if original instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user