Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Barre/privaxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Barre committed May 10, 2022
2 parents 10a8993 + 33fe1ff commit e8a007b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web_frontend/src/requests.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use crate::get_api_host;
use futures::future::{AbortHandle, Abortable};
use futures::StreamExt;
use reqwasm::websocket::futures::WebSocket;
use serde::Deserialize;
use wasm_bindgen_futures::spawn_local;
use yew::{html, Component, Context, Html};

use crate::get_api_host;
const MAX_REQUESTS_SHOWN: usize = 500;

#[derive(Deserialize)]
pub struct Message {
Expand Down Expand Up @@ -60,6 +61,8 @@ impl Component for Requests {
fn update(&mut self, _ctx: &Context<Self>, msg: Self::Message) -> bool {
self.messages.insert(0, msg);

self.messages.truncate(MAX_REQUESTS_SHOWN);

// The server only sends new messages when there is actually
// new data.
true
Expand Down

0 comments on commit e8a007b

Please sign in to comment.