File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import GLib from "gi://GLib" ;
22import Gio from "gi://Gio" ;
3+ import Gtk from "gi://Gtk?version=4.0" ;
34import Soup from "gi://Soup" ;
45
56Gio . _promisify (
@@ -9,8 +10,10 @@ Gio._promisify(
910) ;
1011
1112const http_session = new Soup . Session ( ) ;
12- const article_text_view = workbench . builder . get_object ( "article_text_view" ) ;
13- const article_title = workbench . builder . get_object ( "article_title" ) ;
13+ const article_text_view = workbench . builder . get_object < Gtk . TextView > (
14+ "article_text_view" ,
15+ ) ;
16+ const article_title = workbench . builder . get_object < Gtk . Label > ( "article_title" ) ;
1417
1518fetchWikipediaTodaysFeaturedArticle ( ) . catch ( console . error ) ;
1619
@@ -25,11 +28,12 @@ async function fetchWikipediaTodaysFeaturedArticle() {
2528 ) } `;
2629 const message = Soup . Message . new ( "GET" , url ) ;
2730
31+ // @ts -expect-error undetected async function
2832 const bytes = await http_session . send_and_read_async (
2933 message ,
3034 GLib . PRIORITY_DEFAULT ,
3135 null ,
32- ) ;
36+ ) as GLib . Bytes
3337
3438 if ( message . get_status ( ) !== Soup . Status . OK ) {
3539 console . error ( `HTTP Status ${ message . get_status ( ) } ` ) ;
You can’t perform that action at this time.
0 commit comments