mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
add webln test page
This commit is contained in:
20
resources/js/webln/webln.js
Normal file
20
resources/js/webln/webln.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import {requestProvider} from "webln";
|
||||
|
||||
export default (livewireComponent) => ({
|
||||
|
||||
async init() {
|
||||
console.log('WeBLN initialized');
|
||||
|
||||
let webln;
|
||||
try {
|
||||
webln = await requestProvider();
|
||||
console.log('WeBLN provider acquired');
|
||||
this.$wire.call('logThis', 'WeBLN provider acquired');
|
||||
} catch (err) {
|
||||
// Handle users without WebLN
|
||||
console.error('WeBLN provider request failed:', err);
|
||||
this.$wire.call('logThis', 'WeBLN provider request failed: ' + err);
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user