MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / handle_share_session

Method handle_share_session

crates/opencode-tui/src/app/app.rs:1912–1936  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1910 }
1911
1912 fn handle_share_session(&mut self) {
1913 let Some(session_id) = self.current_session_id() else {
1914 self.alert_dialog.set_message("No active session to share.");
1915 self.alert_dialog.open();
1916 return;
1917 };
1918 let Some(client) = self.context.get_api_client() else {
1919 return;
1920 };
1921 match client.share_session(&session_id) {
1922 Ok(response) => {
1923 let _ = Clipboard::write_text(&response.url);
1924 self.alert_dialog.set_message(&format!(
1925 "Session shared. Link copied to clipboard:\n{}",
1926 response.url
1927 ));
1928 self.alert_dialog.open();
1929 }
1930 Err(err) => {
1931 self.alert_dialog
1932 .set_message(&format!("Failed to share session:\n{}", err));
1933 self.alert_dialog.open();
1934 }
1935 }
1936 }
1937
1938 fn handle_unshare_session(&mut self) {
1939 let Some(session_id) = self.current_session_id() else {

Callers 1

Calls 5

current_session_idMethod · 0.80
set_messageMethod · 0.80
get_api_clientMethod · 0.80
openMethod · 0.45
share_sessionMethod · 0.45

Tested by

no test coverage detected