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:
Fang 2021-06-28 14:44:35 +02:00
parent 4ccfae930c
commit 329ec8ef3f
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
3 changed files with 4 additions and 9 deletions

View File

@ -393,8 +393,6 @@ export default function TermApp(props: TermAppProps) {
// open subscription
//
// TODO start default session alongside other landscape subscriptions,
// once subscription refactor is in.
api.subscribe({ app: 'herm', path: '/session/'+selected,
event: (e) => {
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);
return;
}
showBlit(ses.term, e.data);
showBlit(ses.term, e);
},
quit: () => { // quit
// TODO show user a message

View File

@ -1,13 +1,13 @@
import _ from 'lodash';
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';
export const pokeTask = (session: string, task: Task): Poke<SessionTask> => ({
app: 'herm',
mark: 'herm-task',
json: { session, task }
json: { session, ...task }
});
export const pokeBelt = (

View File

@ -57,7 +57,4 @@ export type Task =
| { hail: null }
| { hook: null }
export type SessionTask = {
session: string,
task: Task
}
export type SessionTask = { session: string } & Task