ensure navigation to file page always has lbry:// prefix

This commit is contained in:
Sean Yesmunt 2018-10-04 00:21:49 -04:00
parent 9c74cd7f64
commit 0ad7a74905

View file

@ -8,6 +8,14 @@ export function doNavigate(path, params = {}, options = {}) {
return;
}
// ensure uri always has "lbry://" prefix
const navigationParams = params;
if (path === '/show') {
if (navigationParams.uri && !navigationParams.uri.startsWith('lbry://')) {
navigationParams.uri = `lbry://${navigationParams.uri}`;
}
}
let url = path;
if (params && Object.values(params).length) {
url += `?${toQueryString(params)}`;