Fixes and change of Firebase API KEY

This commit is contained in:
2022-03-02 19:02:49 -03:00
parent 77d81c5cd2
commit 9cb74858e0
14 changed files with 48 additions and 73 deletions

View File

@@ -96,8 +96,6 @@ const AddWord = () => {
splitedWords = splitedWords.map(word => word.toLowerCase())
splitedWords = splitedWords.map(word => capitalize(word))
console.log(categoryForDatabase);
const uploadWordsPromise = new Promise((resolve, reject) => {
splitedWords.forEach(async (word, index) => {

View File

@@ -12,7 +12,6 @@ const getCategoryForDatabase = async (categorySelection, LanguageSelection) => {
const categoryLocalizated = categoryFirebase.data()[LanguageSelection]
return await categoryLocalizated
console.log(categoryLocalizated)
} catch (error) {

View File

@@ -6,39 +6,6 @@ const DeleteCategoryFirebase = async (category, setData) => {
try {
const db = getFirestore(firestore)
// const categoryEnglishRef = await doc(db, 'categories', category)
// const categoryEnglishSnap = await getDoc(categoryEnglishRef)
// const categoryEnglish = categoryEnglishSnap.data()['english'].toLowerCase()
// const categorySpanishRef = await doc(db, 'categories', category)
// const categorySpanishSnap = await getDoc(categorySpanishRef)
// const categorySpanish = categorySpanishSnap.data()['spanish'].toLowerCase()
// console.log(categoryEnglish)
// console.log(categorySpanish)
// const collectionWordsCategoryEnglish = await collection(db, `hangman_words/english/${categoryEnglish}`)
// const wordsCategoryEnglishRef = await getDocs(collectionWordsCategoryEnglish)
// const wordsCategoryEnglish = await wordsCategoryEnglishRef.docs
// console.log(wordsCategoryEnglish)
// const deleteWordsCategoryEnglishPromise = new Promise((resolve, reject) => {
// wordsCategoryEnglish.forEach(async (documentInCategory, index) => {
// console.log(await documentInCategory.id)
// await deleteDoc(doc(db, `hangman_words/english/${categoryEnglish}`, documentInCategory.id))
// if (index === wordsCategoryEnglish.length -1) resolve();
// })
// })
// deleteWordsCategoryEnglishPromise.then(() => {
// deleteDoc(doc(db, `hangman_words/english/`, categoryEnglish))
// })
await deleteDoc(doc(db, 'categories', category))
} catch (error) {

View File

@@ -65,10 +65,10 @@ function Game() {
setSelectedWord('a')
let word = await BringTheWords(language, category, selectedWord)
word = word.toLowerCase()
word = word.toLowerCase()
await setSelectedWord(word)
await setDisplayApp(true)
setSelectedWord(word)
setDisplayApp(true)
}
}
@@ -172,7 +172,7 @@ function Game() {
AlmacenateLanguage(language)
window.location.reload(false)
}, 3000)
}, 3000)
}
return (

View File

@@ -3,8 +3,6 @@ import {getFirestore, collection, doc, setDoc } from "firebase/firestore/lite";
const AddPokemonToFirebaseQuery = async (language, pokemon) => {
console.log(pokemon)
console.log(language)
try {
const db = await getFirestore(firestore)
const result = await setDoc(doc(db, `hangman_words/${language}/pokemons`, pokemon.name), {

View File

@@ -10,7 +10,6 @@ const PokemonScripts = () => {
const response = await fetch('https://pokeapi.co/api/v2/pokemon?limit=151')
const pokemons = await response.json()
console.log(pokemons)
const uploadWordsPromise = new Promise((resolve, reject) => {
@@ -24,14 +23,6 @@ const PokemonScripts = () => {
await uploadWordsPromise.then(() => {})
// await pokemons.results.forEach(async (pokemon) => {
// console.log(pokemon.name)
// await AddPokemonToFirebaseQuery('english', pokemon)
// });
console.log(pokemons.results.length)
} catch (error) {
}