Disable expire incident button when the incident has already expired

This commit is contained in:
2025-08-23 02:19:05 -03:00
parent c5d699292f
commit 8294fafeba
4 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -83,6 +83,7 @@ pub struct ExpireIncidentButton {
pub user_id: u64,
pub incident_id: u64,
pub incident_index: usize,
pub is_enabled: bool,
}
#[async_trait]
@@ -100,7 +101,7 @@ impl Button<State, Extras> for ExpireIncidentButton {
}
fn disabled(&self) -> bool {
false
!self.is_enabled
}
async fn on_press(
+1
View File
@@ -85,6 +85,7 @@ pub(super) async fn get_incident_page(
incident_id: incident.incident_id,
incident_index: page_index,
user_id,
is_enabled: incident.is_active(),
},
2,
);