Fix redirect

The odysee button change came with passing around the secondary part of
the URL instead of the whole thing. Unfortunately, this change requires
functions to be a little smarter and resolve with the domain lookup.

This was missed for redirects.
This commit is contained in:
Kevin Raoofi 2021-01-21 17:01:35 -05:00
parent a0963db2b4
commit 410a87710b

View file

@ -112,8 +112,9 @@ const handle = (url: URL | Location) => handleURLChange(url, {
render(<WatchOnLbryButton url={url} redirect={redirect} />, mountPoint);
},
onRedirect({ redirect, url }) {
if (redirect === 'app') return openApp(url);
location.replace(url);
const domain = redirectDomains[redirect];
if (redirect === 'app') return openApp(domain.prefix + url);
location.replace(domain.prefix + url);
},
});