@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
13 lines • 553 B
JavaScript
import { from, of, throwError } from "rxjs";
import { catchError, concatMap } from "rxjs/operators";
import appSupportsQuitApp from "../appSupportsQuitApp";
import quitApp from "./quitApp";
const attemptToQuitApp = (transport, appAndVersion) => appAndVersion && appSupportsQuitApp(appAndVersion)
? from(quitApp(transport)).pipe(concatMap(() => of({
type: "appQuitted",
})), catchError(e => throwError(() => e)))
: of({
type: "appDetected",
});
export default attemptToQuitApp;
//# sourceMappingURL=attemptToQuitApp.js.map