History page drawing
This commit is contained in:
+6
-1
@@ -141,6 +141,7 @@ impl SyncState {
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
|
||||
pub fn view(&self) -> Element<'_, SyncMessage> {
|
||||
container(
|
||||
column![
|
||||
@@ -172,6 +173,7 @@ impl SyncState {
|
||||
container(
|
||||
container(text!("{}", key).size(20).font(Font::MONOSPACE)).padding(3)
|
||||
)
|
||||
|
||||
.style(rounded_box),
|
||||
button("Скопировать в буффер обмена")
|
||||
.on_press(SyncMessage::CopyKey)
|
||||
@@ -264,7 +266,10 @@ async fn load_data(id: String) {
|
||||
fn decompress(data: Vec<u8>) -> Vec<u8> {
|
||||
let mut decoder = Decoder::new(&data[..]).unwrap();
|
||||
let mut decompressed = Vec::new();
|
||||
io::copy(&mut decoder, &mut decompressed).unwrap();
|
||||
let res = io::copy(&mut decoder, &mut decompressed);
|
||||
if let Err(e) = res {
|
||||
println!("{}", e);
|
||||
}
|
||||
decompressed
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user