mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-06 19:18:22 +01:00
small updates webshare/archive interaction.
This commit is contained in:
parent
f808c7b362
commit
59fd629920
@ -556,7 +556,7 @@ func ScreenArchiveCommand(ctx context.Context, pk *scpacket.FeCommandPacketType)
|
||||
log.Printf("unarchive screen %s\n", screenId)
|
||||
err = sstore.UnArchiveScreen(ctx, ids.SessionId, screenId)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("/screen:archive cannot re-open screen: %v", err)
|
||||
return nil, fmt.Errorf("/screen:archive cannot un-archive screen: %v", err)
|
||||
}
|
||||
screen, err := sstore.GetScreenById(ctx, screenId)
|
||||
if err != nil {
|
||||
|
@ -1037,6 +1037,9 @@ func ArchiveScreen(ctx context.Context, sessionId string, screenId string) (Upda
|
||||
if !tx.Exists(query, sessionId, screenId) {
|
||||
return fmt.Errorf("cannot close screen (not found)")
|
||||
}
|
||||
if isWebShare(tx, screenId) {
|
||||
return fmt.Errorf("cannot archive screen while web-sharing. stop web-sharing before trying to archive.")
|
||||
}
|
||||
query = `SELECT archived FROM screen WHERE sessionid = ? AND screenid = ?`
|
||||
closeVal := tx.GetBool(query, sessionId, screenId)
|
||||
if closeVal {
|
||||
@ -2435,6 +2438,9 @@ func CanScreenWebShare(screen *ScreenType) error {
|
||||
if screen.ShareMode != ShareModeLocal {
|
||||
return fmt.Errorf("screen cannot be shared, invalid current share mode %q (must be local)", screen.ShareMode)
|
||||
}
|
||||
if screen.Archived {
|
||||
return fmt.Errorf("screen cannot be shared, must un-archive before sharing")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user