Disable expire incident button when the incident has already expired
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user