diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 119621285..37712dde3 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -513,7 +513,7 @@ =/ =ship (slav %p i.t.t.path) =/ =term i.t.t.t.path =/ =index:store - (turn t.t.t.t.path |=(=cord (rash cord dem:ag))) + (turn t.t.t.t.path (cury slav %ud)) =/ node=(unit node:store) (get-node ship term index) ?~ node [~ ~] :- ~ :- ~ :- %graph-update diff --git a/pkg/interface/src/logic/api/graph.ts b/pkg/interface/src/logic/api/graph.ts index 6b08115be..725ca7006 100644 --- a/pkg/interface/src/logic/api/graph.ts +++ b/pkg/interface/src/logic/api/graph.ts @@ -4,6 +4,7 @@ import { Patp, Path, PatpNoSig } from '~/types/noun'; import _ from 'lodash'; import {makeResource, resourceFromPath} from '../lib/group'; import {GroupPolicy, Enc, Post, NodeMap} from '~/types'; +import { numToUd } from '~/logic/lib/util'; export const createPost = (contents: Object[], parentIndex: string = '') => { return { @@ -203,9 +204,10 @@ export default class GraphApi extends BaseApi { } getNode(ship: string, resource: string, index: string) { + const idx = index.split('/').map(numToUd).join('/'); return this.scry( 'graph-store', - `/node/${ship}/${resource}${index}` + `/node/${ship}/${resource}${idx}` ).then((node) => { this.store.handleEvent({ data: node diff --git a/pkg/interface/src/logic/lib/util.js b/pkg/interface/src/logic/lib/util.js index 1c35d5e44..e912c6167 100644 --- a/pkg/interface/src/logic/lib/util.js +++ b/pkg/interface/src/logic/lib/util.js @@ -323,3 +323,15 @@ export function scrollIsAtBottom(container) { } } +/** + * Formats a numbers as a `@ud` inserting dot where needed + */ +export function numToUd(num) { + return _.chain(num.toString()) + .split('') + .reverse() + .chunk(3) + .reverse() + .map(s => s.join('')).join('.') + .value(); +}