2015-12-25 22:42:14 +01:00
|
|
|
/*
|
2021-09-13 18:33:13 +02:00
|
|
|
This file is part of GNU Taler
|
|
|
|
(C) 2021 Taler Systems S.A.
|
2015-12-25 22:42:14 +01:00
|
|
|
|
2021-09-13 18:33:13 +02:00
|
|
|
GNU Taler is free software; you can redistribute it and/or modify it under the
|
2015-12-25 22:42:14 +01:00
|
|
|
terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; either version 3, or (at your option) any later version.
|
|
|
|
|
2021-09-13 18:33:13 +02:00
|
|
|
GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
|
2015-12-25 22:42:14 +01:00
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
2021-09-13 18:33:13 +02:00
|
|
|
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
2015-12-25 22:42:14 +01:00
|
|
|
*/
|
|
|
|
|
2016-02-09 21:56:06 +01:00
|
|
|
/**
|
|
|
|
* Entry point for the background page.
|
2016-09-30 20:45:18 +02:00
|
|
|
*
|
2022-02-23 19:18:37 +01:00
|
|
|
* @author sebasjm
|
2016-02-09 21:56:06 +01:00
|
|
|
*/
|
2016-01-10 20:07:42 +01:00
|
|
|
|
2017-05-24 16:14:23 +02:00
|
|
|
/**
|
|
|
|
* Imports.
|
|
|
|
*/
|
2022-03-23 14:50:12 +01:00
|
|
|
import { platform, setupPlatform } from "./platform/api";
|
|
|
|
import firefoxAPI from "./platform/firefox"
|
|
|
|
import chromeAPI from "./platform/chrome"
|
2019-11-02 00:46:57 +01:00
|
|
|
import { wxMain } from "./wxBackend";
|
2016-09-30 20:45:18 +02:00
|
|
|
|
2022-03-23 14:50:12 +01:00
|
|
|
const isFirefox = typeof (window as any)['InstallTrigger'] !== 'undefined'
|
2022-01-16 21:54:48 +01:00
|
|
|
|
2022-03-23 14:50:12 +01:00
|
|
|
//FIXME: create different entry point for any platform instead of
|
|
|
|
//switching in runtime
|
|
|
|
if (isFirefox) {
|
|
|
|
console.log("Wallet setup for Firefox API")
|
|
|
|
setupPlatform(firefoxAPI)
|
2022-01-16 21:54:48 +01:00
|
|
|
} else {
|
2022-03-23 14:50:12 +01:00
|
|
|
console.log("Wallet setup for Chrome API")
|
|
|
|
setupPlatform(chromeAPI)
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
platform.registerOnInstalled(() => {
|
|
|
|
platform.openWalletPage("/welcome")
|
|
|
|
})
|
|
|
|
} catch (e) {
|
|
|
|
console.error(e);
|
2022-01-16 21:54:48 +01:00
|
|
|
}
|
2022-03-23 14:50:12 +01:00
|
|
|
|
|
|
|
platform.notifyWhenAppIsReady(() => {
|
|
|
|
wxMain();
|
|
|
|
})
|