@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.web.js CHANGED
@@ -3286,11 +3286,16 @@ var useUpdateStudentVocab = (page) => {
3286
3286
  try {
3287
3287
  await api.updateDoc(docPath, data);
3288
3288
  } catch (error) {
3289
- if (error instanceof Error && error.message === "not-found") {
3290
- data.firstSeen = serverTimestamp2();
3291
- await api.setDoc(docPath, data, { merge: true });
3289
+ if (error instanceof Error && "code" in error) {
3290
+ const firebaseError = error;
3291
+ if (firebaseError.code === "not-found") {
3292
+ data.firstSeen = serverTimestamp2();
3293
+ await api.setDoc(docPath, data, { merge: true });
3294
+ } else {
3295
+ console.error("Error actualizando vocabulario:", error);
3296
+ }
3292
3297
  } else {
3293
- console.log(error);
3298
+ console.error("Error desconocido:", error);
3294
3299
  }
3295
3300
  }
3296
3301
  try {