@@ -3,7 +3,11 @@ import { CancelToken } from "navigraph/auth"
33import { packages } from "../Lib/navigraph"
44import { AuthService } from "../Services/AuthService"
55import "./InterfaceSample.css"
6- import { DownloadProgressPhase , NavigraphEventType , NavigraphNavdataInterface } from "@navigraph/msfs-navigation-data-interface"
6+ import {
7+ DownloadProgressPhase ,
8+ NavigraphEventType ,
9+ NavigraphNavdataInterface ,
10+ } from "@navigraph/msfs-navigation-data-interface"
711import { Dropdown } from "./Dropdown"
812
913interface InterfaceSampleProps extends ComponentProps {
@@ -32,12 +36,8 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
3236 this . navdataInterface . onReady ( ( ) => {
3337 this . navdataInterface
3438 . set_active_database ( "avionics_v2" )
35- . then ( ( ) => {
36- console . info ( "WASM set active database" )
37- } )
38- . catch ( e => {
39- this . displayError ( e )
40- } )
39+ . then ( ( ) => console . info ( "WASM set active database" ) )
40+ . catch ( err => this . displayError ( String ( err ) ) )
4141 } )
4242
4343 this . navdataInterface . onEvent ( NavigraphEventType . DownloadProgress , data => {
@@ -100,12 +100,10 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
100100 this . navdataInterface
101101 . get_airport ( this . inputRef . instance . value )
102102 . then ( airport => {
103- console . log ( airport )
103+ console . info ( airport )
104104 console . timeEnd ( "query" )
105105 } )
106- . catch ( e => {
107- console . error ( e )
108- } )
106+ . catch ( e => console . error ( e ) )
109107 } )
110108
111109 AuthService . user . sub ( user => {
@@ -134,7 +132,7 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
134132 this . qrCodeRef . instance . src = `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${ p . verification_uri_complete } `
135133 this . qrCodeRef . instance . style . display = "block"
136134 this . qrCodeRef . instance . onclick = ( ) => {
137- OpenBrowser ( p . verification_uri_complete ) ;
135+ OpenBrowser ( p . verification_uri_complete )
138136 }
139137 }
140138 } , this . cancelSource . token )
@@ -163,7 +161,7 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
163161
164162 const format = this . dropdownRef . instance . getNavigationDataFormat ( )
165163 if ( ! format ) throw new Error ( "Unable to fetch package: No navigation data format has been selected" )
166-
164+
167165 // Get default package for client
168166 const pkg = await packages . getPackage ( format )
169167
0 commit comments