wee fixes

This commit is contained in:
dr-frmr 2024-12-15 18:51:08 -05:00
parent b7973dec50
commit f04e02af17
No known key found for this signature in database
2 changed files with 8 additions and 10 deletions

View File

@ -243,18 +243,12 @@ fn initialize(our: Address) {
.unwrap();
// populate state
// this will add ourselves to the homepage
if let Err(e) = state.fetch() {
println!("failed to fetch settings: {e}");
homepage::add_to_homepage("Settings", Some(ICON), Some("/"), None);
}
// add ourselves to the homepage
homepage::add_to_homepage(
"Settings",
Some(ICON),
Some("/"),
Some(&make_widget(&state)),
);
main_loop(&mut state, &mut http_server);
}
@ -518,7 +512,7 @@ fn make_widget(state: &SettingsState) -> String {
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/kinode.css">
</head>
<body style="margin: 0; padding: 8px; width: 100%; height: 100%;">
<body style="margin: 0; padding: 8px; width: 100%; height: 100%; padding-bottom: 30px;">
<article id="onchain-id">
<h3>{}</h3>
<details style="word-wrap: break-word;">

View File

@ -198,7 +198,11 @@ async fn handle_local_request(
None,
),
NetAction::GetPeer(peer) => (
NetResponse::Peer(data.pki.get(&peer).map(|p| p.clone())),
if peer == ext.our.name {
NetResponse::Peer(Some((*ext.our).clone()))
} else {
NetResponse::Peer(data.pki.get(&peer).map(|p| p.clone()))
},
None,
),
NetAction::GetDiagnostics => {