( state: FileHistoryState, messageId: UUID, )
| 397 | } |
| 398 | |
| 399 | export function fileHistoryCanRestore( |
| 400 | state: FileHistoryState, |
| 401 | messageId: UUID, |
| 402 | ): boolean { |
| 403 | if (!fileHistoryEnabled()) { |
| 404 | return false |
| 405 | } |
| 406 | |
| 407 | return state.snapshots.some(snapshot => snapshot.messageId === messageId) |
| 408 | } |
| 409 | |
| 410 | /** |
| 411 | * Computes diff stats for a file snapshot by counting the number of files that would be changed |
no test coverage detected