fix formatInAppUrl function for open.lbry.com links
This commit is contained in:
parent
2bc4ca0c22
commit
6d2c414363
2 changed files with 9 additions and 5 deletions
|
@ -13,6 +13,7 @@ app.use(async (ctx, next) => {
|
||||||
try {
|
try {
|
||||||
await next();
|
await next();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.log('error: ', err);
|
||||||
ctx.status = err.status || 500;
|
ctx.status = err.status || 500;
|
||||||
ctx.body = err.message;
|
ctx.body = err.message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,16 @@ exports.formatInAppUrl = path => {
|
||||||
if (appPageMatches && appPageMatches.length) {
|
if (appPageMatches && appPageMatches.length) {
|
||||||
// Definitely an app page (or it's formatted like one)
|
// Definitely an app page (or it's formatted like one)
|
||||||
const [, , page, queryString] = appPageMatches;
|
const [, , page, queryString] = appPageMatches;
|
||||||
let actualUrl = '/$/' + page;
|
|
||||||
|
|
||||||
if (queryString) {
|
if (Object.values(PAGES).includes(page)) {
|
||||||
actualUrl += `?${queryString.slice(1)}`;
|
let actualUrl = '/$/' + page;
|
||||||
|
|
||||||
|
if (queryString) {
|
||||||
|
actualUrl += `?${queryString.slice(1)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return actualUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return actualUrl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regular claim url
|
// Regular claim url
|
||||||
|
|
Loading…
Reference in a new issue