opencode-session-bar 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.tsx +7 -8
  2. package/package.json +1 -1
package/index.tsx CHANGED
@@ -30,6 +30,12 @@ function View(props: { api: TuiPluginApi; sessionID: string }) {
30
30
  setDeleting(prev => { const next = new Set(prev); next.delete(id); return next })
31
31
  }
32
32
  }
33
+ onMount(() => {
34
+ const unsub1 = props.api.event.on("session.updated", () => refetch())
35
+ const unsub2 = props.api.event.on("session.deleted", () => refetch())
36
+ const unsub3 = props.api.event.on("session.created", () => refetch())
37
+ onCleanup(() => { unsub1(); unsub2(); unsub3() })
38
+ })
33
39
 
34
40
  return (
35
41
  <box>
@@ -43,14 +49,7 @@ function View(props: { api: TuiPluginApi; sessionID: string }) {
43
49
  <For each={sorted()}>
44
50
  {(session) => {
45
51
  const isDeleting = deleting().has(session.id)
46
- onMount(() => {
47
- const unsub1 = props.api.event.on("session.updated", () => refetch())
48
- const unsub2 = props.api.event.on("session.deleted", () => refetch())
49
- const unsub3 = props.api.event.on("session.created", () => refetch())
50
- onCleanup(() => { unsub1(); unsub2(); unsub3() })
51
- })
52
-
53
- return (
52
+ return (
54
53
  <box flexDirection="row" justifyContent="space-between" overflow="hidden">
55
54
  <text
56
55
  fg={theme().textMuted}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-session-bar",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "OpenCode TUI sidebar plugin — list all sessions with quick switch and delete",
5
5
  "type": "module",
6
6
  "exports": {