notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit adb2a4ecb4e210a40f6dcbc99fe64edb5ab7e224
parent 7e539c639bc26b02547bf9bee8b48be9424a4a09
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 30 Nov 2022 11:13:23 -0800

some more misc updates

Diffstat:
Msrc/app.rs | 11++++++++---
Msrc/lib.rs | 3++-
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/app.rs b/src/app.rs @@ -5,6 +5,7 @@ use egui_extras::RetainedImage; use poll_promise::Promise; //use std::borrow::{Borrow, Cow}; use egui::Context; +use log::error; use std::collections::HashMap; use std::hash::Hash; use tracing::debug; @@ -134,7 +135,8 @@ fn render_pfp<'a>(ui: &mut egui::Ui, img_cache: &mut ImageCache<'a>, pk: &str, u None => { ui.spinner(); // still loading } - Some(Err(_err)) => { + Some(Err(err)) => { + error!("Initial image load failed: {}", err); let failed_key = UrlKey::Failed(&url); let m_failed_promise = img_cache.get_mut(&failed_key); if m_failed_promise.is_none() { @@ -146,7 +148,8 @@ fn render_pfp<'a>(ui: &mut egui::Ui, img_cache: &mut ImageCache<'a>, pk: &str, u None => { ui.spinner(); // still loading } - Some(Err(_err)) => { + Some(Err(e)) => { + error!("Image load error: {}", e); ui.label("❌"); } Some(Ok(img)) => { @@ -176,7 +179,9 @@ fn render_username(ui: &mut egui::Ui, pk: &str) { fn render_event(ui: &mut egui::Ui, img_cache: &mut ImageCache<'_>, ev: &Event) { ui.with_layout(egui::Layout::left_to_right(egui::Align::TOP), |ui| { let damus_pic = "https://damus.io/img/damus.svg".into(); - let jb55_pic = "https://damus.io/img/red-me.jpg".into(); + //let damus_pic = "https://192.168.87.26/img/damus.svg".into(); + let jb55_pic = "https://cdn.jb55.com/img/red-me.jpg".into(); + //let jb55_pic = "http://192.168.87.26/img/red-me.jpg".into(); let pic = if ev.pub_key == "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245" { jb55_pic diff --git a/src/lib.rs b/src/lib.rs @@ -8,7 +8,7 @@ use ::egui::FontDefinitions; use chrono::Timelike; use egui_wgpu_backend::{RenderPass, ScreenDescriptor}; use egui_winit_platform::{Platform, PlatformDescriptor}; -use log::{error, warn}; +use log::{error, info, warn}; use std::iter; use std::time::Instant; use wgpu::CompositeAlphaMode; @@ -65,6 +65,7 @@ fn android_main(app: winit::platform::android::activity::AndroidApp) { .build(); main(event_loop); } + pub fn main(mut event_loop: EventLoop<WinitEvent>) { //'Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.', ..../winit-c2fdb27092aba5a7/418cc44/src/platform_impl/android/mod.rs:1028:13 warn!("Winit build window at {} line {}", file!(), line!());