diff --git a/ng-app/src/apps/ProfileEditor.svelte b/ng-app/src/apps/ProfileEditor.svelte index 8c1a524d..542b5cba 100644 --- a/ng-app/src/apps/ProfileEditor.svelte +++ b/ng-app/src/apps/ProfileEditor.svelte @@ -60,7 +60,7 @@ console.log($cur_tab.doc.nuri); //TODO: more sanitation on the input here! await ng.sparql_update($active_session.session_id, "PREFIX vcard: " - +"INSERT DATA { <> a vcard:Individual . <> vcard:fn \""+name.replace('"',"\\\"")+"\". <> vcard:hasEmail \""+email+"\" }", "did:ng:"+$cur_tab.doc.nuri ); + +"INSERT DATA { <> a vcard:Individual . <> vcard:fn \""+name.trim().replace('"',"\\\"")+"\". <> vcard:hasEmail \""+email.trim()+"\" }", "did:ng:"+$cur_tab.doc.nuri ); toast_success("Your profile was edited successfully!"); set_view_or_edit(true); } catch (e) { diff --git a/ng-app/src/apps/SocialQueryDemo.svelte b/ng-app/src/apps/SocialQueryDemo.svelte index 33582b0c..fe06c327 100644 --- a/ng-app/src/apps/SocialQueryDemo.svelte +++ b/ng-app/src/apps/SocialQueryDemo.svelte @@ -66,6 +66,7 @@ ORDER BY DESC(?total)`; $: source = commits.graph.join(" .\r\n") + (commits.graph.length ? " .":""); let results = []; + let already_started = false; $: if (commits.graph.length > 4) { sparql_query(ranking_query, false).then((res) => { @@ -74,6 +75,17 @@ ORDER BY DESC(?total)`; }); } + $: if (commits) { check_if_started(commits.graph) } + + function check_if_started(graph) { + for (const g of graph) { + if (g.substring(57,91) === "did:ng:x:ng#social_query_forwarder") { + already_started = true; + break; + } + } + } + const query = `PREFIX vcard: PREFIX xskills: PREFIX ksp: @@ -120,6 +132,7 @@ WHERE { let session = $active_session; if (!session) return; let request_nuri = "did:ng:"+$cur_tab.doc.nuri+":c:"+commit_id+":k:"+commit_key; + console.log(request_nuri) await ng.social_query_start( session.session_id, "did:ng:a", @@ -145,7 +158,7 @@ WHERE {