fix: tokio runtime, Enter-to-login, and server URL handling
Three bugs fixed: - No tokio reactor: glib::spawn_future_local does not provide a tokio context, so reqwest/hyper panicked at runtime. Introduce src/runtime.rs with a multi-thread tokio Runtime (init() called from main before the GTK app starts). runtime::spawn() posts the async result back to GTK via a tokio oneshot channel awaited by glib::spawn_future_local, which only polls a flag (no I/O). runtime::spawn_bg() is used for fire-and-forget background calls. - Enter key didn't submit login: connect_apply on AdwEntryRow only fires when show-apply-button is true. Switch to connect_entry_activated which fires on Return in all three login rows. - Wrong API URL: the app constructed /accounts/ClientLogin directly off the server host, yielding a 404. Add normalize_base_url() in api.rs that appends /api/greader.php when the URL doesn't already contain it, so users can enter just https://rss.example.com.
This commit is contained in:
parent
d157f3f244
commit
5dee5cc52b
6 changed files with 161 additions and 67 deletions
|
|
@ -20,6 +20,7 @@ template $LoginDialog : Adw.Dialog {
|
|||
title: _("Server URL");
|
||||
input-hints: no_spellcheck;
|
||||
input-purpose: url;
|
||||
// e.g. https://rss.example.com — /api/greader.php is added automatically
|
||||
}
|
||||
|
||||
Adw.EntryRow username_row {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue