mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-21 13:51:50 +03:00
webterm: fix broken api interactions
We hadn't adapted to the new subscription event callback yet, and were sending a slightly misshapen herm task for pokes.
This commit is contained in:
parent
4ccfae930c
commit
329ec8ef3f
@ -393,8 +393,6 @@ export default function TermApp(props: TermAppProps) {
|
|||||||
|
|
||||||
// open subscription
|
// open subscription
|
||||||
//
|
//
|
||||||
// TODO start default session alongside other landscape subscriptions,
|
|
||||||
// once subscription refactor is in.
|
|
||||||
api.subscribe({ app: 'herm', path: '/session/'+selected,
|
api.subscribe({ app: 'herm', path: '/session/'+selected,
|
||||||
event: (e) => {
|
event: (e) => {
|
||||||
const ses = useTermState.getState().sessions[selected];
|
const ses = useTermState.getState().sessions[selected];
|
||||||
@ -402,7 +400,7 @@ export default function TermApp(props: TermAppProps) {
|
|||||||
console.log('on blit: no such session', selected, sessions, useTermState.getState().sessions);
|
console.log('on blit: no such session', selected, sessions, useTermState.getState().sessions);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showBlit(ses.term, e.data);
|
showBlit(ses.term, e);
|
||||||
},
|
},
|
||||||
quit: () => { // quit
|
quit: () => { // quit
|
||||||
// TODO show user a message
|
// TODO show user a message
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
import { Scry } from '../lib'
|
import { Scry } from '../lib'
|
||||||
import { Enc, Path, Patp, PatpNoSig, Poke, Thread } from '../lib/types';
|
import { Poke } from '../lib/types';
|
||||||
import { Belt, Task, SessionTask } from './types';
|
import { Belt, Task, SessionTask } from './types';
|
||||||
|
|
||||||
export const pokeTask = (session: string, task: Task): Poke<SessionTask> => ({
|
export const pokeTask = (session: string, task: Task): Poke<SessionTask> => ({
|
||||||
app: 'herm',
|
app: 'herm',
|
||||||
mark: 'herm-task',
|
mark: 'herm-task',
|
||||||
json: { session, task }
|
json: { session, ...task }
|
||||||
});
|
});
|
||||||
|
|
||||||
export const pokeBelt = (
|
export const pokeBelt = (
|
||||||
|
@ -57,7 +57,4 @@ export type Task =
|
|||||||
| { hail: null }
|
| { hail: null }
|
||||||
| { hook: null }
|
| { hook: null }
|
||||||
|
|
||||||
export type SessionTask = {
|
export type SessionTask = { session: string } & Task
|
||||||
session: string,
|
|
||||||
task: Task
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user