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:
parent
2614a3fc11
commit
2385b5f5c8
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user