tweak: rename event

This commit is contained in:
Aiden Cline
2025-10-27 10:42:47 -05:00
parent b562863fcc
commit e6301ca5d5
2 changed files with 5 additions and 5 deletions

View File

@@ -78,8 +78,8 @@ export namespace Session {
export type ShareInfo = z.output<typeof ShareInfo>
export const Event = {
Started: Bus.event(
"session.started",
Created: Bus.event(
"session.created",
z.object({
info: Info,
}),
@@ -173,7 +173,7 @@ export namespace Session {
}
log.info("created", result)
await Storage.write(["session", Instance.project.id, result.id], result)
Bus.publish(Event.Started, {
Bus.publish(Event.Created, {
info: result,
})
const cfg = await Config.get()

View File

@@ -16,7 +16,7 @@ describe("session.started event", () => {
let eventReceived = false
let receivedInfo: Session.Info | undefined
const unsub = Bus.subscribe(Session.Event.Started, (event) => {
const unsub = Bus.subscribe(Session.Event.Created, (event) => {
eventReceived = true
receivedInfo = event.properties.info as Session.Info
})
@@ -45,7 +45,7 @@ describe("session.started event", () => {
fn: async () => {
const events: string[] = []
const unsubStarted = Bus.subscribe(Session.Event.Started, () => {
const unsubStarted = Bus.subscribe(Session.Event.Created, () => {
events.push("started")
})