mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 19:13:43 +00:00
refactor(*):Address PR comments
This commit is contained in:
@@ -13,15 +13,25 @@
|
||||
export let supabase: any;
|
||||
|
||||
async function signInWithEmail() {
|
||||
// TODO use the data and error from the response
|
||||
const { data, error } = await supabase.auth
|
||||
.signInWithPassword({
|
||||
try {
|
||||
const { data, error } = await supabase.auth.signInWithPassword({
|
||||
email: email,
|
||||
password: password
|
||||
})
|
||||
.then(() => {
|
||||
emitSignedInEvent();
|
||||
});
|
||||
|
||||
if (error) {
|
||||
console.error('Sign in error:', error);
|
||||
alert(`Sign in failed: ${error.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data) {
|
||||
emitSignedInEvent();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Sign in error:', err);
|
||||
alert('Sign in failed');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
// Create a working copy for editing
|
||||
$: workingCatchRecord = catchRecord || {
|
||||
_id: '',
|
||||
userId: '',
|
||||
_id: `temp-${Date.now()}-${pokedexEntry._id}`, // Generate temporary ID
|
||||
userId: '', // TODO: Get from session context
|
||||
pokedexEntryId: pokedexEntry._id,
|
||||
haveToEvolve: false,
|
||||
caught: false,
|
||||
@@ -136,8 +136,9 @@
|
||||
</div>
|
||||
{/if}
|
||||
<p>
|
||||
<label class="block font-bold mb-1" for={`personalNotesInput-${catchRecord?._id || pokedexEntry._id}`}
|
||||
>Notes:</label
|
||||
<label
|
||||
class="block font-bold mb-1"
|
||||
for={`personalNotesInput-${catchRecord?._id || pokedexEntry._id}`}>Notes:</label
|
||||
>
|
||||
<textarea
|
||||
bind:value={workingCatchRecord.personalNotes}
|
||||
|
||||
Reference in New Issue
Block a user