Disable expire incident button when the incident has already expired
This commit is contained in:
Generated
+1
-1
@@ -1437,7 +1437,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
|
||||
|
||||
[[package]]
|
||||
name = "payphone"
|
||||
version = "4.2.8"
|
||||
version = "4.2.10"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"axum",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "payphone"
|
||||
version = "4.2.8"
|
||||
version = "4.2.10"
|
||||
edition = "2024"
|
||||
default-run = "payphone"
|
||||
|
||||
|
||||
@@ -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