From 97325d72efff30f884284df3e7d749f1ce6302b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Mon, 11 Oct 2021 17:08:00 +0200 Subject: [PATCH] Reduce memory footprint, fix alloc vec error --- actors/websocket-actor/src/handlers/issues.rs | 4 ++-- web/src/components/styled_md_editor.rs | 4 ++-- web/src/modals/issues_edit/update.rs | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/actors/websocket-actor/src/handlers/issues.rs b/actors/websocket-actor/src/handlers/issues.rs index 4f0402d5..f1d0b00d 100644 --- a/actors/websocket-actor/src/handlers/issues.rs +++ b/actors/websocket-actor/src/handlers/issues.rs @@ -128,8 +128,8 @@ impl AsyncHandler for WebSocketActor { issue_type: msg.issue_type, issue_status_id: msg.issue_status_id, priority: msg.priority, - description: msg.description, - description_text: msg.description_text, + description: msg.description.clone(), + description_text: msg.description_text.or(msg.description), estimate: msg.estimate, time_spent: msg.time_spent, time_remaining: msg.time_remaining, diff --git a/web/src/components/styled_md_editor.rs b/web/src/components/styled_md_editor.rs index 1fbe2e02..357dfe47 100644 --- a/web/src/components/styled_md_editor.rs +++ b/web/src/components/styled_md_editor.rs @@ -77,7 +77,7 @@ impl<'l> StyledMdEditor<'l> { let StyledMdEditor { id, initial_text, - text: _, + text, html, mode, update_event, @@ -94,7 +94,7 @@ impl<'l> StyledMdEditor<'l> { let text_area = StyledTextarea { id: Some(id), height: 40, - value: initial_text, + value: if text.is_empty() { initial_text } else { text }, update_event, ..Default::default() } diff --git a/web/src/modals/issues_edit/update.rs b/web/src/modals/issues_edit/update.rs index 38c7535d..8f73d49b 100644 --- a/web/src/modals/issues_edit/update.rs +++ b/web/src/modals/issues_edit/update.rs @@ -15,6 +15,11 @@ pub fn update(msg: &Msg, model: &mut Model, orders: &mut impl Orders) { modal.update_states(msg, orders); 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)) => { let m = model.issues_by_id.get(id).cloned(); if let Some(issue) = m {