i stopped properly committing my work
This commit is contained in:
12
index.js
12
index.js
@@ -1,15 +1,21 @@
|
||||
import { signIn as _signIn } from './roadhog.js';
|
||||
import { createUser } from './user.js';
|
||||
|
||||
const endpoint = "http://localhost:3000";
|
||||
|
||||
let address = '';
|
||||
let networkType = '';
|
||||
|
||||
async function signIn(type) {
|
||||
try {
|
||||
const result = await _signIn(type);
|
||||
if (result.success) {
|
||||
console.log('Successfully signed in with', type);
|
||||
address = result.address;
|
||||
networkType = type;
|
||||
const b = document.createElement('button');
|
||||
b.innerText = 'Click to access protected';
|
||||
b.setAttribute('onclick', 'fetchProtected()');
|
||||
b.setAttribute('onclick', 'doStuff()');
|
||||
document.body.appendChild(b);
|
||||
} else {
|
||||
console.error('Sign-in failed:', result.error);
|
||||
@@ -20,11 +26,13 @@ async function signIn(type) {
|
||||
}
|
||||
|
||||
async function signOff() {
|
||||
|
||||
}
|
||||
|
||||
window.signIn = signIn;
|
||||
window.signOff = signOff;
|
||||
window.doStuff = async function doStuff(type) {
|
||||
await createUser('test user', networkType, address);
|
||||
}
|
||||
|
||||
function init() {
|
||||
console.log('start');
|
||||
|
||||
Reference in New Issue
Block a user