feat: persist API keys across restarts via tauri-plugin-store
All checks were successful
Android Universal Build / build-android (push) Successful in 12m9s

Keys are saved to keys.json in the app's private data directory
on both Linux and Android. load_keys is called on app mount to
restore them into NewsState before the first news fetch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 15:44:36 +01:00
parent a91537fccf
commit f91cdb0801
5 changed files with 46 additions and 10 deletions

View File

@@ -69,11 +69,12 @@ pub fn news() -> Html {
let new_url_ref = use_node_ref();
let new_cat_ref = use_node_ref();
// Init: RSS Feeds laden
// Init: Keys und RSS Feeds laden
{
let rss_feeds = rss_feeds.clone();
use_effect_with((), move |_| {
spawn_local(async move {
let _ = invoke("load_keys", JsValue::NULL).await;
if let Ok(res) = invoke("load_rss_config", JsValue::NULL).await {
if let Ok(feeds) = serde_wasm_bindgen::from_value::<Vec<RssFeed>>(res) {
rss_feeds.set(feeds);