Try to detect stale type changes when hotpatching

This commit is contained in:
Héctor Ramón Jiménez 2025-06-10 02:32:22 +02:00
parent c1c5fbda61
commit 699b85762b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 72 additions and 14 deletions

View file

@ -343,21 +343,30 @@ where
themer(derive_theme(), Element::from(mode).map(Event::Message))
});
let notification = self.show_notification.then(|| {
themer(
derive_theme(),
bottom_right(opaque(
container(text("Press F12 to open debug metrics"))
.padding(10)
.style(container::dark),
)),
)
});
let notification = self
.show_notification
.then(|| text("Press F12 to open debug metrics"))
.or_else(|| {
debug::is_stale().then(|| {
text(
"Types have changed. Restart to re-enable hotpatching.",
)
})
});
stack![view]
.height(Fill)
.push_maybe(mode.map(opaque))
.push_maybe(notification)
.push_maybe(notification.map(|notification| {
themer(
derive_theme(),
bottom_right(opaque(
container(notification)
.padding(10)
.style(container::dark),
)),
)
}))
.into()
}