@speakableio/core 1.0.55 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.native.js
CHANGED
|
@@ -3402,11 +3402,16 @@ var useUpdateStudentVocab = (page) => {
|
|
|
3402
3402
|
try {
|
|
3403
3403
|
await api.updateDoc(docPath, data);
|
|
3404
3404
|
} catch (error) {
|
|
3405
|
-
if (error instanceof Error &&
|
|
3406
|
-
|
|
3407
|
-
|
|
3405
|
+
if (error instanceof Error && "code" in error) {
|
|
3406
|
+
const firebaseError = error;
|
|
3407
|
+
if (firebaseError.code === "not-found") {
|
|
3408
|
+
data.firstSeen = serverTimestamp2();
|
|
3409
|
+
await api.setDoc(docPath, data, { merge: true });
|
|
3410
|
+
} else {
|
|
3411
|
+
console.error("Error actualizando vocabulario:", error);
|
|
3412
|
+
}
|
|
3408
3413
|
} else {
|
|
3409
|
-
console.
|
|
3414
|
+
console.error("Error desconocido:", error);
|
|
3410
3415
|
}
|
|
3411
3416
|
}
|
|
3412
3417
|
try {
|