robosats/frontend/src/utils/webln.ts

21 lines
478 B
TypeScript
Raw Normal View History

2022-09-09 17:18:04 +00:00
import { requestProvider, WeblnProvider } from 'webln';
Add Nav Bar, Settings Page, large refactor (#308) commit a5b63aed93e084fae19d9e444e06238a52f24f3a Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 10:46:05 2022 -0700 Small fixes commit d64adfc2bf9b9c31dca47ab113c06a1268c347c6 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 06:02:06 2022 -0700 wip work on federation settings commit ca35d6b3d2776812b07109e197d2e1d46f9f4e81 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 04:05:33 2022 -0700 Refactor confirmation Dialogs commit c660a5b0d1345d4996efb10cb8999987689bede9 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sat Oct 29 13:36:59 2022 -0700 refactor login (clean separation robot/info. Style navbar. commit b9dc7f7c95a683e3aca024ec6d7857176b4e3a25 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Fri Oct 28 09:54:38 2022 -0700 Add size slider and settings widget commit 20b2b3dcd6838b129741705f1c65d445271e231d Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Fri Oct 28 05:41:48 2022 -0700 Add show more and Dialogs commit da8b70091b5f28139cdec1a8895f4563d64d8e88 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 27 16:26:07 2022 -0700 Add sliding pages commit 6dd90aa1182a7a5e0f0189d1467ba474b68c28c2 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 27 06:34:58 2022 -0700 Add settings forms commit d3d0f3ee1a52bbf1829714050cc798d2542af8f6 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Wed Oct 26 04:16:06 2022 -0700 Refactor utils
2022-10-30 19:13:01 +00:00
const getWebln = async (): Promise<WeblnProvider> => {
const resultPromise = new Promise<WeblnProvider>(async (resolve, reject) => {
try {
2022-09-09 17:18:04 +00:00
const webln = await requestProvider();
if (webln) {
2022-09-09 17:18:04 +00:00
webln.enable();
resolve(webln);
}
} catch (err) {
2022-09-09 17:18:04 +00:00
console.log("Coulnd't connect to Webln");
reject();
}
2022-09-09 17:18:04 +00:00
});
return await resultPromise;
2022-09-09 17:18:04 +00:00
};
Add Nav Bar, Settings Page, large refactor (#308) commit a5b63aed93e084fae19d9e444e06238a52f24f3a Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 10:46:05 2022 -0700 Small fixes commit d64adfc2bf9b9c31dca47ab113c06a1268c347c6 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 06:02:06 2022 -0700 wip work on federation settings commit ca35d6b3d2776812b07109e197d2e1d46f9f4e81 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 04:05:33 2022 -0700 Refactor confirmation Dialogs commit c660a5b0d1345d4996efb10cb8999987689bede9 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sat Oct 29 13:36:59 2022 -0700 refactor login (clean separation robot/info. Style navbar. commit b9dc7f7c95a683e3aca024ec6d7857176b4e3a25 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Fri Oct 28 09:54:38 2022 -0700 Add size slider and settings widget commit 20b2b3dcd6838b129741705f1c65d445271e231d Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Fri Oct 28 05:41:48 2022 -0700 Add show more and Dialogs commit da8b70091b5f28139cdec1a8895f4563d64d8e88 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 27 16:26:07 2022 -0700 Add sliding pages commit 6dd90aa1182a7a5e0f0189d1467ba474b68c28c2 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 27 06:34:58 2022 -0700 Add settings forms commit d3d0f3ee1a52bbf1829714050cc798d2542af8f6 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Wed Oct 26 04:16:06 2022 -0700 Refactor utils
2022-10-30 19:13:01 +00:00
export default getWebln;