commit b6dd0f4733cf64cd3b54715e2898537f444fb341
parent a967486a225b3ad800a980e772920c8083ceb8a3
Author: Marcel <mtrnord1@gmail.com>
Date: Wed, 27 May 2020 12:03:16 +0200
Use Linked hashmap for events to keep ordering
Took 13 minutes
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
@@ -31,6 +31,7 @@ yew_styles = "0.3.1"
thiserror = "1.0"
futures-locks = { git = "https://github.com/asomers/futures-locks", default-features = false }
js_int = "0.1.5"
+linked_hash_set = {version = "0.1.3", features = ["serde"] }
[dev-dependencies]
wasm-bindgen-test = "0.3"
diff --git a/src/app/views/main_view.rs b/src/app/views/main_view.rs
@@ -10,6 +10,7 @@ use yew::ComponentLink;
use crate::app::matrix::types::{MessageWrapper, SmallRoom};
use crate::app::matrix::{MatrixAgent, Request, Response};
+use linked_hash_set::LinkedHashSet;
pub struct MainView {
link: ComponentLink<Self>,
@@ -25,7 +26,7 @@ pub enum Msg {
#[derive(Serialize, Deserialize, Default)]
pub struct State {
// TODO handle all events
- pub events: HashSet<MessageWrapper>,
+ pub events: LinkedHashSet<MessageWrapper>,
pub rooms: HashMap<RoomId, SmallRoom>,
pub current_room: Option<RoomId>,
}