Reduce memory footprint, fix alloc vec error

This commit is contained in:
Adrian Woźniak 2021-10-11 17:08:00 +02:00
parent 8478f5d112
commit 97325d72ef
No known key found for this signature in database
GPG Key ID: DE43476F72AD3F6C
3 changed files with 9 additions and 4 deletions

View File

@ -128,8 +128,8 @@ impl AsyncHandler<CreateIssuePayload> for WebSocketActor {
issue_type: msg.issue_type, issue_type: msg.issue_type,
issue_status_id: msg.issue_status_id, issue_status_id: msg.issue_status_id,
priority: msg.priority, priority: msg.priority,
description: msg.description, description: msg.description.clone(),
description_text: msg.description_text, description_text: msg.description_text.or(msg.description),
estimate: msg.estimate, estimate: msg.estimate,
time_spent: msg.time_spent, time_spent: msg.time_spent,
time_remaining: msg.time_remaining, time_remaining: msg.time_remaining,

View File

@ -77,7 +77,7 @@ impl<'l> StyledMdEditor<'l> {
let StyledMdEditor { let StyledMdEditor {
id, id,
initial_text, initial_text,
text: _, text,
html, html,
mode, mode,
update_event, update_event,
@ -94,7 +94,7 @@ impl<'l> StyledMdEditor<'l> {
let text_area = StyledTextarea { let text_area = StyledTextarea {
id: Some(id), id: Some(id),
height: 40, height: 40,
value: initial_text, value: if text.is_empty() { initial_text } else { text },
update_event, update_event,
..Default::default() ..Default::default()
} }

View File

@ -15,6 +15,11 @@ pub fn update(msg: &Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
modal.update_states(msg, orders); modal.update_states(msg, orders);
match msg { match msg {
Msg::ResourceChanged(ResourceKind::Issue, OperationKind::SingleRemoved, Some(id)) => {
if modal.id == *id {
orders.send_msg(crate::Msg::ModalDropped);
}
}
Msg::ResourceChanged(ResourceKind::Issue, OperationKind::SingleModified, Some(id)) => { Msg::ResourceChanged(ResourceKind::Issue, OperationKind::SingleModified, Some(id)) => {
let m = model.issues_by_id.get(id).cloned(); let m = model.issues_by_id.get(id).cloned();
if let Some(issue) = m { if let Some(issue) = m {