( result: ResumeResult, )
| 155 | * Returns undefined if attribution feature is disabled or no snapshots exist. |
| 156 | */ |
| 157 | export function computeRestoredAttributionState( |
| 158 | result: ResumeResult, |
| 159 | ): AttributionState | undefined { |
| 160 | if ( |
| 161 | feature('COMMIT_ATTRIBUTION') && |
| 162 | result.attributionSnapshots && |
| 163 | result.attributionSnapshots.length > 0 |
| 164 | ) { |
| 165 | return restoreAttributionStateFromSnapshots(result.attributionSnapshots) |
| 166 | } |
| 167 | return undefined |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Compute standalone agent context (name/color) for session resume. |
no test coverage detected