Remove video link even if search fail (duh)
The bar was just staying there after having been displayed once.
This commit is contained in:
parent
8d7e24270c
commit
67beeca09d
|
@ -28,16 +28,16 @@ function peertubeify(query: string) {
|
||||||
browser.runtime.sendMessage({
|
browser.runtime.sendMessage({
|
||||||
query
|
query
|
||||||
}).then(async video => {
|
}).then(async video => {
|
||||||
removeVideoLink();
|
|
||||||
|
|
||||||
const options = await browser.storage.local.get();
|
const options = await browser.storage.local.get();
|
||||||
const openInOriginalInstance = _.getOr(true, 'openInOriginalInstance', options);
|
const openInOriginalInstance = _.getOr(true, 'openInOriginalInstance', options);
|
||||||
const searchInstance = _.getOr(constants.defaultInstance, 'searchInstance', options);
|
const searchInstance = _.getOr(constants.defaultInstance, 'searchInstance', options);
|
||||||
|
|
||||||
const url = watchURL(openInOriginalInstance ? video.account.host : searchInstance, video.uuid);
|
const url = watchURL(openInOriginalInstance ? video.account.host : searchInstance, video.uuid);
|
||||||
const link = videoLink(url, video);
|
const link = videoLink(url, video);
|
||||||
|
|
||||||
|
removeVideoLink();
|
||||||
document.querySelector('ytd-app').appendChild(link);
|
document.querySelector('ytd-app').appendChild(link);
|
||||||
});
|
}).catch(removeVideoLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
const throttledPeertubify = _.throttle(1000, peertubeify);
|
const throttledPeertubify = _.throttle(1000, peertubeify);
|
||||||
|
|
Loading…
Reference in New Issue