lesson 23 remaining vocab
This commit is contained in:
1 parent
82b51c0703
commit
fced071837
2 files changed
+408
-88
No files matched your search
@@ -210,23 +210,31 @@ watch(quizState, () => {
|
||||
saveQuizState();
|
||||
});
|
||||
|
||||
let timeoutSetExNotes = 0;
|
||||
|
||||
watch(example, () => {
|
||||
exNotes.value = "";
|
||||
if (!example.value) return;
|
||||
if (timeoutSetExNotes) return;
|
||||
|
||||
if (supabase) {
|
||||
let { ko } = example.value;
|
||||
ko = ko.replaceAll("**", "");
|
||||
timeoutSetExNotes = window.setTimeout(() => {
|
||||
timeoutSetExNotes = 0;
|
||||
|
||||
supabase
|
||||
.from("sentence-explain")
|
||||
.select<any, { explain: string }>("explain")
|
||||
.eq("ko", ko)
|
||||
.then((r) => {
|
||||
if (!r.data?.[0]) return;
|
||||
exNotes.value = r.data[0].explain;
|
||||
});
|
||||
}
|
||||
exNotes.value = "";
|
||||
if (!example.value) return;
|
||||
|
||||
if (supabase) {
|
||||
let { ko } = example.value;
|
||||
ko = ko.replaceAll("**", "");
|
||||
|
||||
supabase
|
||||
.from("sentence-explain")
|
||||
.select<any, { explain: string }>("explain")
|
||||
.eq("ko", ko)
|
||||
.then((r) => {
|
||||
if (!r.data?.[0]) return;
|
||||
exNotes.value = r.data[0].explain;
|
||||
});
|
||||
}
|
||||
}, 50);
|
||||
});
|
||||
|
||||
const vocabulary: Record<string, IVoc[]> = {};
|
||||
@@ -450,9 +458,7 @@ async function explainSentence(ko: string) {
|
||||
}
|
||||
|
||||
if (supabase) {
|
||||
console.log(supabase);
|
||||
const user_id = await supabase.auth.getUser().then((r) => r.data.user?.id);
|
||||
console.log(user_id);
|
||||
|
||||
await supabase.from("sentence-explain").upsert(
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user