| 1 | package main |
| 2 | |
| 3 | import "strings" |
| 4 | |
| 5 | func prepareRestoredTabIdentity(tab *WorkspaceTab, entry desktopTabEntry) bool { |
| 6 | tab.goal = strings.TrimSpace(entry.Goal) |
| 7 | tab.SessionHeadID = entry.SessionHeadID |
| 8 | if entry.historicalSource != nil { |
| 9 | // Only the current single surface reaches this function during startup. |
| 10 | // Preserve its native identity; no import is needed to restore execution. |
| 11 | tab.SessionPath = entry.historicalSource.Path |
| 12 | tab.SessionHeadID = entry.historicalSource.HeadID |
| 13 | tab.retainLegacyPinnedFiles(entry.PinnedFiles) |
| 14 | return true |
| 15 | } |
| 16 | if entry.restoreBlocked { |
| 17 | tab.StartupErr = "Saved session identity could not be verified. Recovery data was preserved." |
| 18 | tab.retainLegacyPinnedFiles(entry.PinnedFiles) |
| 19 | return false |
| 20 | } |
| 21 | tab.goal = runningTabSessionGoal(strings.TrimSpace(entry.SessionPath), tab.goal) |
| 22 | restoreTabPinnedContext(tab, entry.PinnedFiles) |
| 23 | return true |
| 24 | } |
| 25 |