| 503 | if generation_clock.load(Ordering::Acquire) != generation { |
| 504 | return; |
| 505 | } |
| 506 | let Ok((content, model)) = result else { |
| 507 | let _ = view.update(app, |this, cx| { |
| 508 | if formatted && this.requested_body == Some(key) { |
| 509 | this.requested_body = None; |
| 510 | } else if !formatted && this.requested_raw == Some(key) { |
| 511 | this.requested_raw = None; |
| 512 | } |
| 513 | cx.notify(); |
| 514 | }); |
| 515 | return; |
| 516 | }; |
| 517 | |
| 518 | let is_current = response.read(app).data.as_ref().is_some_and(|data| { |
| 519 | data.body_hash() == key.body_hash && data.content_category() == key.category |
| 520 | }); |
| 521 | if !is_current { |
| 522 | let _ = view.update(app, |this, cx| { |
| 523 | if formatted && this.requested_body == Some(key) { |
| 524 | this.requested_body = None; |
| 525 | } else if !formatted && this.requested_raw == Some(key) { |
| 526 | this.requested_raw = None; |
| 527 | } |
| 528 | cx.notify(); |
| 529 | }); |
| 530 | return; |
| 531 | } |
| 532 | |
| 533 | response.update(app, |response, _cx| { |
| 534 | if let Some(data) = response.data.as_mut() { |