Skip to content

Commit 4b13265

Browse files
committed
feat(tui): copy share url to clipboard
1 parent 26bab00 commit 4b13265

File tree

1 file changed

+5
-1
lines changed
  • packages/tui/internal/tui

1 file changed

+5
-1
lines changed

packages/tui/internal/tui/tui.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,16 @@ func (a appModel) executeCommand(command commands.Command) (tea.Model, tea.Cmd)
398398
if a.app.Session.Id == "" {
399399
return a, nil
400400
}
401-
a.app.Client.PostSessionShareWithResponse(
401+
response, _ := a.app.Client.PostSessionShareWithResponse(
402402
context.Background(),
403403
client.PostSessionShareJSONRequestBody{
404404
SessionID: a.app.Session.Id,
405405
},
406406
)
407+
if response.JSON200 != nil && response.JSON200.Share != nil {
408+
shareUrl := response.JSON200.Share.Url
409+
cmds = append(cmds, tea.SetClipboard(shareUrl))
410+
}
407411
case commands.SessionInterruptCommand:
408412
if a.app.Session.Id == "" {
409413
return a, nil

0 commit comments

Comments
 (0)