Merge pull request #51 from Aenigma/feature/odysee-button-hotfix

Hotfixes for odysee button
This commit is contained in:
kodxana 2021-01-21 23:11:35 +01:00 committed by GitHub
commit ab707bf533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -3,7 +3,7 @@
"version": "1.5.4",
"license": "GPL-3.0",
"scripts": {
"build:assets": "cpx \"src/**/*.{json,png}\" dist/",
"build:assets": "cpx \"src/**/*.{json,png,svg}\" dist/",
"watch:assets": "cpx --watch -v \"src/**/*.{json,png,svg}\" dist/",
"build:parcel": "cross-env NODE_ENV=production parcel build --no-source-maps --no-minify \"src/scripts/*.{js,jsx,ts,tsx}\" \"src/**/*.html\"",
"watch:parcel": "parcel watch --no-hmr --no-source-maps \"src/scripts/*.{js,jsx,ts,tsx}\" \"src/**/*.html\"",

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);
},
});