This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,8 +277,8 @@ export const RunCommand = cmd({
277277 }
278278 return { error }
279279 } )
280- if ( ! shareResult . error ) {
281- UI . println ( UI . Style . TEXT_INFO_BOLD + "~ https://opencode.ai/s/ " + sessionID . slice ( - 8 ) )
280+ if ( ! shareResult . error && "data" in shareResult && shareResult . data ?. share ?. url ) {
281+ UI . println ( UI . Style . TEXT_INFO_BOLD + "~ " + shareResult . data . share . url )
282282 }
283283 }
284284
@@ -330,8 +330,8 @@ export const RunCommand = cmd({
330330 }
331331 return { error }
332332 } )
333- if ( ! shareResult . error ) {
334- UI . println ( UI . Style . TEXT_INFO_BOLD + "~ https://opencode.ai/s/ " + sessionID . slice ( - 8 ) )
333+ if ( ! shareResult . error && "data" in shareResult && shareResult . data ?. share ?. url ) {
334+ UI . println ( UI . Style . TEXT_INFO_BOLD + "~ " + shareResult . data . share . url )
335335 }
336336 }
337337
Original file line number Diff line number Diff line change @@ -323,10 +323,13 @@ export function Session() {
323323 keybind : "session_unshare" ,
324324 disabled : ! session ( ) ?. share ?. url ,
325325 category : "Session" ,
326- onSelect : ( dialog ) => {
327- sdk . client . session . unshare ( {
328- sessionID : route . sessionID ,
329- } )
326+ onSelect : async ( dialog ) => {
327+ await sdk . client . session
328+ . unshare ( {
329+ sessionID : route . sessionID ,
330+ } )
331+ . then ( ( ) => toast . show ( { message : "Session unshared successfully" , variant : "success" } ) )
332+ . catch ( ( ) => toast . show ( { message : "Failed to unshare session" , variant : "error" } ) )
330333 dialog . clear ( )
331334 } ,
332335 } ,
Original file line number Diff line number Diff line change @@ -234,22 +234,12 @@ export namespace Session {
234234 } )
235235
236236 export const unshare = fn ( Identifier . schema ( "session" ) , async ( id ) => {
237- const cfg = await Config . get ( )
238- if ( cfg . enterprise ?. url ) {
239- const { ShareNext } = await import ( "@/share/share-next" )
240- await ShareNext . remove ( id )
241- await update ( id , ( draft ) => {
242- draft . share = undefined
243- } )
244- }
245- const share = await getShare ( id )
246- if ( ! share ) return
247- await Storage . remove ( [ "share" , id ] )
237+ // Use ShareNext to remove the share (same as share function uses ShareNext to create)
238+ const { ShareNext } = await import ( "@/share/share-next" )
239+ await ShareNext . remove ( id )
248240 await update ( id , ( draft ) => {
249241 draft . share = undefined
250242 } )
251- const { Share } = await import ( "../share/share" )
252- await Share . remove ( id , share . secret )
253243 } )
254244
255245 export async function update ( id : string , editor : ( session : Info ) => void ) {
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export namespace ShareNext {
157157 secret : share . secret ,
158158 } ) ,
159159 } )
160- await Storage . remove ( [ "session_share" , share . id ] )
160+ await Storage . remove ( [ "session_share" , sessionID ] )
161161 }
162162
163163 async function fullSync ( sessionID : string ) {
You can’t perform that action at this time.
0 commit comments