1import ob from 'urbit-ob';
3import { ensurePatFormat } from 'form/formatters';
5// looks into the GET parameters and attempts to construct a "flow" object,
6// which would indicate bridge is to be used for one specific flow.
7// expects to find any of the following sets of parameters, varying by kind.
10// & as = ~ship // who to send the invite as
11// & ship = ~ship // what planet to send as the invite
12// & email = ex@amp.le // email to send the invite code to
19const useFlowCommand = () => {
21 window.location.search
25 if ('' === arg) return;
26 const pam = arg.split('=');
27 flow[pam[0]] = pam.length <= 1 ? true : decodeURIComponent(pam[1]);
30 if (typeof flow === 'object') {
33 flow.as = ensurePatFormat(flow.as);
34 flow.ship = ensurePatFormat(flow.ship);
35 if (!ob.isValidPatp(flow.as) || !ob.isValidPatp(flow.ship)) {
36 console.log('invalid inviting flow arguments', flow.as, flow.ship);
42 console.log('unrecognized kind of flow:', flow.kind);
43 // eslint-disable-next-line no-fallthrough
55export { COMMANDS, useFlowCommand };
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list