@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.
@@ -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 && error.message === "not-found") {
3406
- data.firstSeen = serverTimestamp2();
3407
- await api.setDoc(docPath, data, { merge: true });
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.log(error);
3414
+ console.error("Error desconocido:", error);
3410
3415
  }
3411
3416
  }
3412
3417
  try {