app: ipfs loading improvements:

use IPFSClient from wabac.js
app: remove # from ipfs paths sent to app
preload interface made more extensible
This commit is contained in:
Ilya Kreymer
2020-12-09 22:46:16 -08:00
parent dfdebe9f69
commit cd40979625
7 changed files with 72 additions and 78 deletions
+2 -1
View File
@@ -134,7 +134,8 @@ You can select a file to upload from the main page by clicking the \'Choose File
case "ipfs":
if (IS_APP) {
const url = new URL(__APP_FILE_SERVE_PREFIX__);
url.searchParams.set("ipfs", sourceUrl.slice("ipfs://".length));
const hash = sourceUrl.split("#", 1)[0];
url.searchParams.set("ipfs", hash.slice("ipfs://".length));
source = {sourceUrl, loadUrl: url.href};
}
break;