Build and render arvo:// urls correctly

This commit is contained in:
Fang 2019-07-29 09:05:42 +02:00
parent e6f962e76e
commit 34826d6e19
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 2 additions and 5 deletions

View File

@ -173,7 +173,7 @@ export class ChatInput extends Component {
//TODO send proper url speeches once hall starts using a url type that
// supports non-http protocols.
return { lin: {
msg: 'arvo://' + url.slice(urlObject.origin.length+1),
msg: 'arvo://' + url.slice(urlObject.origin.length),
pat: false
} };
} else {

View File

@ -147,10 +147,7 @@ export class Message extends Component {
if (url.indexOf(arvo) === 0) {
// this application is being served by an urbit also, so /path will
// point to the arvo url as hosted by this same urbit.
let path = url.slice(arvo.length);
// ensure single leading /
if (path[0] !== '/') path = '/' + path;
return path;
return url.slice(arvo.length);
} else {
return url;
}