@@ -3,7 +3,11 @@ import { CancelToken } from "navigraph/auth"
3
3
import { packages } from "../Lib/navigraph"
4
4
import { AuthService } from "../Services/AuthService"
5
5
import "./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"
7
11
import { Dropdown } from "./Dropdown"
8
12
9
13
interface InterfaceSampleProps extends ComponentProps {
@@ -32,12 +36,8 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
32
36
this . navdataInterface . onReady ( ( ) => {
33
37
this . navdataInterface
34
38
. 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 ) ) )
41
41
} )
42
42
43
43
this . navdataInterface . onEvent ( NavigraphEventType . DownloadProgress , data => {
@@ -100,12 +100,10 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
100
100
this . navdataInterface
101
101
. get_airport ( this . inputRef . instance . value )
102
102
. then ( airport => {
103
- console . log ( airport )
103
+ console . info ( airport )
104
104
console . timeEnd ( "query" )
105
105
} )
106
- . catch ( e => {
107
- console . error ( e )
108
- } )
106
+ . catch ( e => console . error ( e ) )
109
107
} )
110
108
111
109
AuthService . user . sub ( user => {
@@ -134,7 +132,7 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
134
132
this . qrCodeRef . instance . src = `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${ p . verification_uri_complete } `
135
133
this . qrCodeRef . instance . style . display = "block"
136
134
this . qrCodeRef . instance . onclick = ( ) => {
137
- OpenBrowser ( p . verification_uri_complete ) ;
135
+ OpenBrowser ( p . verification_uri_complete )
138
136
}
139
137
}
140
138
} , this . cancelSource . token )
@@ -163,7 +161,7 @@ export class InterfaceSample extends DisplayComponent<InterfaceSampleProps> {
163
161
164
162
const format = this . dropdownRef . instance . getNavigationDataFormat ( )
165
163
if ( ! format ) throw new Error ( "Unable to fetch package: No navigation data format has been selected" )
166
-
164
+
167
165
// Get default package for client
168
166
const pkg = await packages . getPackage ( format )
169
167
0 commit comments