Skip to content

Commit

Permalink
Update public build.
Browse files Browse the repository at this point in the history
  • Loading branch information
freedomsmuggler committed Apr 23, 2024
1 parent b807352 commit ad78520
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 107 deletions.
90 changes: 34 additions & 56 deletions docs/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ function create_if_block_1(ctx) {
return block;
}

// (1:0) <script> import { getContext, onDestroy }
// (1:0) <script> import { getContext, onDestroy }
function create_catch_block(ctx) {
const block = {
c: noop,
Expand All @@ -1378,14 +1378,14 @@ function create_catch_block(ctx) {
block,
id: create_catch_block.name,
type: "catch",
source: "(1:0) <script> import { getContext, onDestroy }",
source: "(1:0) <script> import { getContext, onDestroy }",
ctx
});

return block;
}

// (44:49) <svelte:component this={resolvedComponent?.default || resolvedComponent}
// (44:49) <svelte:component this={resolvedComponent?.default || resolvedComponent}
function create_then_block(ctx) {
let switch_instance;
let switch_instance_anchor;
Expand Down Expand Up @@ -1471,14 +1471,14 @@ function create_then_block(ctx) {
block,
id: create_then_block.name,
type: "then",
source: "(44:49) <svelte:component this={resolvedComponent?.default || resolvedComponent}",
source: "(44:49) <svelte:component this={resolvedComponent?.default || resolvedComponent}",
ctx
});

return block;
}

// (1:0) <script> import { getContext, onDestroy }
// (1:0) <script> import { getContext, onDestroy }
function create_pending_block(ctx) {
const block = {
c: noop,
Expand All @@ -1493,7 +1493,7 @@ function create_pending_block(ctx) {
block,
id: create_pending_block.name,
type: "pending",
source: "(1:0) <script> import { getContext, onDestroy }",
source: "(1:0) <script> import { getContext, onDestroy }",
ctx
});

Expand Down Expand Up @@ -2040,7 +2040,7 @@ function create_key_block(ctx) {
c: function create() {
div = element("div");
if (default_slot) default_slot.c();
add_location(div, file$3, 135, 8, 4794);
add_location(div, file$3, 135, 8, 4659);
},
m: function mount(target, anchor) {
insert_dev(target, div, anchor);
Expand Down Expand Up @@ -24385,7 +24385,7 @@ var NDK = class extends lib$1.EventEmitter {

/* src\Login.svelte generated by Svelte v3.59.2 */

const { Error: Error_1, console: console_1 } = globals;
const { console: console_1 } = globals;
const file = "src\\Login.svelte";

function create_fragment(ctx) {
Expand Down Expand Up @@ -24443,28 +24443,28 @@ function create_fragment(ctx) {
a2 = element("a");
a2.textContent = "Nostore__";
attr_dev(button, "class", "btn");
add_location(button, file, 62, 4, 1962);
add_location(button, file, 46, 4, 1164);
attr_dev(div0, "class", "wrapper");
add_location(div0, file, 61, 0, 1935);
add_location(p0, file, 67, 8, 2115);
add_location(p1, file, 68, 8, 2161);
add_location(div0, file, 45, 0, 1137);
add_location(p0, file, 51, 8, 1317);
add_location(p1, file, 52, 8, 1363);
attr_dev(a0, "href", "https://chromewebstore.google.com/detail/ampjiinddmggbhpebhaegmjkbbeofoaj");
add_location(a0, file, 71, 24, 2266);
add_location(li0, file, 70, 12, 2236);
add_location(a0, file, 55, 24, 1468);
add_location(li0, file, 54, 12, 1438);
attr_dev(a1, "href", "https://addons.mozilla.org/en-US/firefox/addon/nostr-connect/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search");
add_location(a1, file, 74, 25, 2431);
add_location(li1, file, 73, 12, 2400);
add_location(a1, file, 58, 25, 1633);
add_location(li1, file, 57, 12, 1602);
attr_dev(a2, "href", "https://apps.apple.com/us/app/nostore/id1666553677");
add_location(a2, file, 77, 30, 2658);
add_location(li2, file, 76, 12, 2622);
add_location(ul, file, 69, 8, 2218);
add_location(a2, file, 61, 30, 1860);
add_location(li2, file, 60, 12, 1824);
add_location(ul, file, 53, 8, 1420);
attr_dev(div1, "class", "register-link");
add_location(div1, file, 66, 4, 2078);
add_location(div1, file, 50, 4, 1280);
attr_dev(div2, "class", "wrapper");
add_location(div2, file, 65, 0, 2051);
add_location(div2, file, 49, 0, 1253);
},
l: function claim(nodes) {
throw new Error_1("options.hydrate only works if the component was compiled with the `hydratable: true` option");
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) {
insert_dev(target, div0, anchor);
Expand Down Expand Up @@ -24520,52 +24520,30 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
validate_slots('Login', slots, []);
const RELAYS_URL = ['wss://relay.snort.social', 'wss://relay.primal.net', 'wss://relay.damus.io'];
const ndk = new NDK(); // Instantiating NDK here
let pool;
let events = [];

onMount(async () => {
pool = new SimplePool();

return () => {
pool.unsub();
};
});
const RELAYS_URL = ['wss://relay.snort.social', 'wss://relay.primal.net', 'wss://relay.damus.io'];
const nip07signer = new NDKNip07Signer();
let publicKey = {};

async function extlogin() {
try {
if (!window.nostr) {
throw new Error('Nostr extension not found. Please install the extension.');
}

await ndk.connect(); // Using the previously instantiated NDK
const nip07signer = new NDKNip07Signer();
const publicKey = await nip07signer.user();

if (!!publicKey.pubkey) {
if (publicKey.pubkey) {
console.log("Permission granted to read their public key:", publicKey.pubkey);
}

// Create a subscription to listen for events related to the user's profile
const subEvents = pool.sub(RELAYS_URL, [
{
kinds: [0], // Filter events by kind (assuming profile events have kind 0)
limit: 1,
authors: [publicKey.pubkey]
}
]);
publicKey = await nip07signer.user();
const pool = new SimplePool();
const subEvents = pool.sub(RELAYS_URL, [{ kinds: [0], authors: [publicKey.pubkey] }]);

subEvents.on('event', event => {
events = [...events, event];
eventsStore.set(events);
});

// Navigate to the TodoPage component
navigate('/todoPage');
} catch(error) {
console.error('Login failed:', error.message);
alert(error.message); // Display the error message to the user
alert(error.message);
}
}

Expand All @@ -24582,16 +24560,16 @@ function instance($$self, $$props, $$invalidate) {
NDK,
NDKNip07Signer,
navigate,
RELAYS_URL,
ndk,
pool,
events,
RELAYS_URL,
nip07signer,
publicKey,
extlogin
});

$$self.$inject_state = $$props => {
if ('pool' in $$props) pool = $$props.pool;
if ('events' in $$props) events = $$props.events;
if ('publicKey' in $$props) publicKey = $$props.publicKey;
};

if ($$props && "$$inject" in $$props) {
Expand Down
2 changes: 1 addition & 1 deletion docs/build/bundle.js.map

Large diffs are not rendered by default.

76 changes: 27 additions & 49 deletions public/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -24385,7 +24385,7 @@ var NDK = class extends lib$1.EventEmitter {

/* src\Login.svelte generated by Svelte v3.59.2 */

const { Error: Error_1, console: console_1 } = globals;
const { console: console_1 } = globals;
const file = "src\\Login.svelte";

function create_fragment(ctx) {
Expand Down Expand Up @@ -24443,28 +24443,28 @@ function create_fragment(ctx) {
a2 = element("a");
a2.textContent = "Nostore__";
attr_dev(button, "class", "btn");
add_location(button, file, 62, 4, 1962);
add_location(button, file, 46, 4, 1164);
attr_dev(div0, "class", "wrapper");
add_location(div0, file, 61, 0, 1935);
add_location(p0, file, 67, 8, 2115);
add_location(p1, file, 68, 8, 2161);
add_location(div0, file, 45, 0, 1137);
add_location(p0, file, 51, 8, 1317);
add_location(p1, file, 52, 8, 1363);
attr_dev(a0, "href", "https://chromewebstore.google.com/detail/ampjiinddmggbhpebhaegmjkbbeofoaj");
add_location(a0, file, 71, 24, 2266);
add_location(li0, file, 70, 12, 2236);
add_location(a0, file, 55, 24, 1468);
add_location(li0, file, 54, 12, 1438);
attr_dev(a1, "href", "https://addons.mozilla.org/en-US/firefox/addon/nostr-connect/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search");
add_location(a1, file, 74, 25, 2431);
add_location(li1, file, 73, 12, 2400);
add_location(a1, file, 58, 25, 1633);
add_location(li1, file, 57, 12, 1602);
attr_dev(a2, "href", "https://apps.apple.com/us/app/nostore/id1666553677");
add_location(a2, file, 77, 30, 2658);
add_location(li2, file, 76, 12, 2622);
add_location(ul, file, 69, 8, 2218);
add_location(a2, file, 61, 30, 1860);
add_location(li2, file, 60, 12, 1824);
add_location(ul, file, 53, 8, 1420);
attr_dev(div1, "class", "register-link");
add_location(div1, file, 66, 4, 2078);
add_location(div1, file, 50, 4, 1280);
attr_dev(div2, "class", "wrapper");
add_location(div2, file, 65, 0, 2051);
add_location(div2, file, 49, 0, 1253);
},
l: function claim(nodes) {
throw new Error_1("options.hydrate only works if the component was compiled with the `hydratable: true` option");
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) {
insert_dev(target, div0, anchor);
Expand Down Expand Up @@ -24520,52 +24520,30 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
validate_slots('Login', slots, []);
const RELAYS_URL = ['wss://relay.snort.social', 'wss://relay.primal.net', 'wss://relay.damus.io'];
const ndk = new NDK(); // Instantiating NDK here
let pool;
let events = [];

onMount(async () => {
pool = new SimplePool();

return () => {
pool.unsub();
};
});
const RELAYS_URL = ['wss://relay.snort.social', 'wss://relay.primal.net', 'wss://relay.damus.io'];
const nip07signer = new NDKNip07Signer();
let publicKey = {};

async function extlogin() {
try {
if (!window.nostr) {
throw new Error('Nostr extension not found. Please install the extension.');
}

await ndk.connect(); // Using the previously instantiated NDK
const nip07signer = new NDKNip07Signer();
const publicKey = await nip07signer.user();

if (!!publicKey.pubkey) {
if (publicKey.pubkey) {
console.log("Permission granted to read their public key:", publicKey.pubkey);
}

// Create a subscription to listen for events related to the user's profile
const subEvents = pool.sub(RELAYS_URL, [
{
kinds: [0], // Filter events by kind (assuming profile events have kind 0)
limit: 1,
authors: [publicKey.pubkey]
}
]);
publicKey = await nip07signer.user();
const pool = new SimplePool();
const subEvents = pool.sub(RELAYS_URL, [{ kinds: [0], authors: [publicKey.pubkey] }]);

subEvents.on('event', event => {
events = [...events, event];
eventsStore.set(events);
});

// Navigate to the TodoPage component
navigate('/todoPage');
} catch(error) {
console.error('Login failed:', error.message);
alert(error.message); // Display the error message to the user
alert(error.message);
}
}

Expand All @@ -24582,16 +24560,16 @@ function instance($$self, $$props, $$invalidate) {
NDK,
NDKNip07Signer,
navigate,
RELAYS_URL,
ndk,
pool,
events,
RELAYS_URL,
nip07signer,
publicKey,
extlogin
});

$$self.$inject_state = $$props => {
if ('pool' in $$props) pool = $$props.pool;
if ('events' in $$props) events = $$props.events;
if ('publicKey' in $$props) publicKey = $$props.publicKey;
};

if ($$props && "$$inject" in $$props) {
Expand Down
2 changes: 1 addition & 1 deletion public/build/bundle.js.map

Large diffs are not rendered by default.

0 comments on commit ad78520

Please sign in to comment.