This commit is contained in:
Kerry Ivan Kurian 2018-09-20 10:53:32 -07:00
parent 5445d6f670
commit afa8e44e66

View file

@ -55,9 +55,9 @@ Rectangle {
} }
} }
function isHttp(str) { function toUrl(resource) {
var httpPattern = /^http/i; var httpPattern = /^http/i;
return httpPattern.test(str); return httpPattern.test(str) ? resource : "file:///" + resource;
} }
Component.onCompleted: { Component.onCompleted: {
@ -89,9 +89,10 @@ Rectangle {
MyAvatar.useFullAvatarURL(resource); MyAvatar.useFullAvatarURL(resource);
break; break;
case "content set": case "content set":
resource = isHttp(resource) ? resource : "file:///" + resource;
urlHandler.handleUrl("hifi://localhost/0,0,0"); urlHandler.handleUrl("hifi://localhost/0,0,0");
Commerce.replaceContentSet(resource, ""); Commerce.replaceContentSet(toUrl(resource), "");
break;
case "entity":
break; break;
} }
// XXX support other resource types here. // XXX support other resource types here.