some more misc updates
This commit is contained in:
11
src/app.rs
11
src/app.rs
@@ -5,6 +5,7 @@ use egui_extras::RetainedImage;
|
|||||||
use poll_promise::Promise;
|
use poll_promise::Promise;
|
||||||
//use std::borrow::{Borrow, Cow};
|
//use std::borrow::{Borrow, Cow};
|
||||||
use egui::Context;
|
use egui::Context;
|
||||||
|
use log::error;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
@@ -134,7 +135,8 @@ fn render_pfp<'a>(ui: &mut egui::Ui, img_cache: &mut ImageCache<'a>, pk: &str, u
|
|||||||
None => {
|
None => {
|
||||||
ui.spinner(); // still loading
|
ui.spinner(); // still loading
|
||||||
}
|
}
|
||||||
Some(Err(_err)) => {
|
Some(Err(err)) => {
|
||||||
|
error!("Initial image load failed: {}", err);
|
||||||
let failed_key = UrlKey::Failed(&url);
|
let failed_key = UrlKey::Failed(&url);
|
||||||
let m_failed_promise = img_cache.get_mut(&failed_key);
|
let m_failed_promise = img_cache.get_mut(&failed_key);
|
||||||
if m_failed_promise.is_none() {
|
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 => {
|
None => {
|
||||||
ui.spinner(); // still loading
|
ui.spinner(); // still loading
|
||||||
}
|
}
|
||||||
Some(Err(_err)) => {
|
Some(Err(e)) => {
|
||||||
|
error!("Image load error: {}", e);
|
||||||
ui.label("❌");
|
ui.label("❌");
|
||||||
}
|
}
|
||||||
Some(Ok(img)) => {
|
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) {
|
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| {
|
ui.with_layout(egui::Layout::left_to_right(egui::Align::TOP), |ui| {
|
||||||
let damus_pic = "https://damus.io/img/damus.svg".into();
|
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 =
|
let pic =
|
||||||
if ev.pub_key == "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245" {
|
if ev.pub_key == "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245" {
|
||||||
jb55_pic
|
jb55_pic
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use ::egui::FontDefinitions;
|
|||||||
use chrono::Timelike;
|
use chrono::Timelike;
|
||||||
use egui_wgpu_backend::{RenderPass, ScreenDescriptor};
|
use egui_wgpu_backend::{RenderPass, ScreenDescriptor};
|
||||||
use egui_winit_platform::{Platform, PlatformDescriptor};
|
use egui_winit_platform::{Platform, PlatformDescriptor};
|
||||||
use log::{error, warn};
|
use log::{error, info, warn};
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use wgpu::CompositeAlphaMode;
|
use wgpu::CompositeAlphaMode;
|
||||||
@@ -65,6 +65,7 @@ fn android_main(app: winit::platform::android::activity::AndroidApp) {
|
|||||||
.build();
|
.build();
|
||||||
main(event_loop);
|
main(event_loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main(mut event_loop: EventLoop<WinitEvent>) {
|
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
|
//'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!());
|
warn!("Winit build window at {} line {}", file!(), line!());
|
||||||
|
|||||||
Reference in New Issue
Block a user