Subscriptions working
This commit is contained in:
@ -100,7 +100,8 @@ export class App {
|
||||
this.defaultLocation = "/";
|
||||
this.setHash("/");
|
||||
} else {
|
||||
throw Error(response.message);
|
||||
console.error(response.error);
|
||||
throw Error(response.error.message || response.error.code);
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,14 +238,14 @@ export class App {
|
||||
this.addMessage(input.value);
|
||||
const val = input.value;
|
||||
input.value = "";
|
||||
await this.session.sendEvent("60nc0XXDIYUh6QzX4p0rMpCdzDmxghZLZk8dLuQh628", {
|
||||
await this.session.newEvent("60nc0XXDIYUh6QzX4p0rMpCdzDmxghZLZk8dLuQh628", {
|
||||
message: val,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.session.subscribe(response => {
|
||||
this.addMessage(response.data.event.data.message);
|
||||
this.addMessage(response.data.data.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user