|
|
@@ -190,12 +190,12 @@ const EventoDetalleGrupo = () => {
|
|
|
// Hay indices que salen en undefined y salió error al guardar en firebase
|
|
|
try {
|
|
|
resultado = JSON.parse(JSON.stringify(resultado));
|
|
|
- } catch (e) {}
|
|
|
+ } catch (e) { }
|
|
|
|
|
|
// Sale un error en firebase de que no puede guardar información en undefined (no se encontró dónde)
|
|
|
try {
|
|
|
usuarios = JSON.parse(JSON.stringify(usuarios));
|
|
|
- } catch (e) {}
|
|
|
+ } catch (e) { }
|
|
|
|
|
|
let body = {
|
|
|
usuarios,
|
|
|
@@ -205,10 +205,10 @@ const EventoDetalleGrupo = () => {
|
|
|
await updateDoc(doc(firestore, "eventos", evento?.id), body);
|
|
|
history.push(
|
|
|
urlweb +
|
|
|
- "/resultado-grupo-evento?id=" +
|
|
|
- evento?.id +
|
|
|
- "&tag=" +
|
|
|
- evento?.tag,
|
|
|
+ "/resultado-grupo-evento?id=" +
|
|
|
+ evento?.id +
|
|
|
+ "&tag=" +
|
|
|
+ evento?.tag,
|
|
|
);
|
|
|
setVisible(false);
|
|
|
} catch (error) {
|
|
|
@@ -299,6 +299,9 @@ const EventoDetalleGrupo = () => {
|
|
|
const eventoTw = _redesEvento.find((i) => i?.redSocial === "Twitter")
|
|
|
? true
|
|
|
: false;
|
|
|
+ const eventoTt = _redesEvento.find((i) => i?.redSocial === "TikTok")
|
|
|
+ ? true
|
|
|
+ : false;
|
|
|
|
|
|
_usuarios?.forEach((u) => {
|
|
|
const uid = u?.uid;
|
|
|
@@ -317,6 +320,7 @@ const EventoDetalleGrupo = () => {
|
|
|
fb: eventoFb && tieneFb,
|
|
|
ig: eventoIg && tieneIg,
|
|
|
tw: eventoTw && tieneTw,
|
|
|
+ tt: eventoTt /* && tieneTw */,
|
|
|
};
|
|
|
|
|
|
arrUsuarios.push(usuario);
|
|
|
@@ -329,9 +333,11 @@ const EventoDetalleGrupo = () => {
|
|
|
estatus: "Nuevo",
|
|
|
enviado: null,
|
|
|
fecha: new Date(),
|
|
|
+ url: eventos.map((e) => `${REACT_APP_WEB_URL}evento-laud?id=${e?.id}`),
|
|
|
urlFB: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Facebook")?.id}`,
|
|
|
urlIG: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Instagram")?.id}`,
|
|
|
urlTW: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Twitter")?.id}`,
|
|
|
+ urlTT: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "TikTok")?.id}`,
|
|
|
usuarios: arrUsuarios,
|
|
|
};
|
|
|
|
|
|
@@ -344,6 +350,9 @@ const EventoDetalleGrupo = () => {
|
|
|
if (!eventoTw) {
|
|
|
body.urlTW = "";
|
|
|
}
|
|
|
+ if (!eventoTt) {
|
|
|
+ body.urlTT = "";
|
|
|
+ }
|
|
|
|
|
|
// Buscamos si existe un registro con el ID del evento y la misma plantilla
|
|
|
const q = firebaseQuery(
|
|
|
@@ -388,6 +397,7 @@ const EventoDetalleGrupo = () => {
|
|
|
let eventoFb = null;
|
|
|
let eventoTw = null;
|
|
|
let eventoIg = null;
|
|
|
+ let eventoTt = null;
|
|
|
|
|
|
for (let i = 0; i < eventos.length; i++) {
|
|
|
if (eventos[i].redSocial === "Facebook") {
|
|
|
@@ -396,6 +406,8 @@ const EventoDetalleGrupo = () => {
|
|
|
eventoIg = eventos[i];
|
|
|
} else if (eventos[i].redSocial === "Twitter") {
|
|
|
eventoTw = eventos[i];
|
|
|
+ } else if (eventos[i].redSocial === "TikTok") {
|
|
|
+ eventoTt = eventos[i];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -424,6 +436,7 @@ const EventoDetalleGrupo = () => {
|
|
|
fb: tieneFb && eventoFb?.resultado[uid]?.length === 0,
|
|
|
ig: tieneIg && eventoIg?.resultado[uid]?.length === 0,
|
|
|
tw: tieneTw && eventoTw?.resultado[uid]?.length === 0,
|
|
|
+ tt: /* tieneTw && */eventoTt?.resultado[uid]?.length === 0,
|
|
|
};
|
|
|
|
|
|
if (!usuario.fb && !usuario.ig && !usuario.tw) {
|
|
|
@@ -443,6 +456,7 @@ const EventoDetalleGrupo = () => {
|
|
|
urlFB: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Facebook")?.id}`,
|
|
|
urlIG: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Instagram")?.id}`,
|
|
|
urlTW: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Twitter")?.id}`,
|
|
|
+ urlTT: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "TikTok")?.id}`,
|
|
|
usuarios: arrUsuarios,
|
|
|
};
|
|
|
|
|
|
@@ -455,6 +469,9 @@ const EventoDetalleGrupo = () => {
|
|
|
if (!eventoTw) {
|
|
|
body.urlTW = "";
|
|
|
}
|
|
|
+ if (!eventoTt) {
|
|
|
+ body.urlTT = "";
|
|
|
+ }
|
|
|
|
|
|
// Buscamos si existe un registro con el ID del evento y la misma plantilla
|
|
|
const q = firebaseQuery(
|
|
|
@@ -499,6 +516,7 @@ const EventoDetalleGrupo = () => {
|
|
|
let eventoFb = null;
|
|
|
let eventoTw = null;
|
|
|
let eventoIg = null;
|
|
|
+ let eventoTt = null;
|
|
|
|
|
|
for (let i = 0; i < eventos.length; i++) {
|
|
|
if (eventos[i]?.redSocial === "Facebook") {
|
|
|
@@ -507,6 +525,8 @@ const EventoDetalleGrupo = () => {
|
|
|
eventoIg = eventos[i];
|
|
|
} else if (eventos[i]?.redSocial === "Twitter") {
|
|
|
eventoTw = eventos[i];
|
|
|
+ } else if (eventos[i]?.redSocial === "TikTok") {
|
|
|
+ eventoTt = eventos[i];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -535,7 +555,8 @@ const EventoDetalleGrupo = () => {
|
|
|
const res =
|
|
|
eventoFb?.resultado[uid].length +
|
|
|
eventoIg?.resultado[uid].length +
|
|
|
- eventoTw?.resultado[uid].length;
|
|
|
+ eventoTw?.resultado[uid].length +
|
|
|
+ eventoTt?.resultado[uid].length;
|
|
|
|
|
|
const usuario = {
|
|
|
uid,
|
|
|
@@ -544,6 +565,7 @@ const EventoDetalleGrupo = () => {
|
|
|
fb: tieneFb && eventoFb?.resultado[uid]?.length > 0,
|
|
|
ig: tieneIg && eventoIg?.resultado[uid]?.length > 0,
|
|
|
tw: tieneTw && eventoTw?.resultado[uid]?.length > 0,
|
|
|
+ tt: /* tieneTw && */eventoTw?.resultado[uid]?.length > 0,
|
|
|
};
|
|
|
|
|
|
// if( (res/cr) === 1 ) {
|
|
|
@@ -566,6 +588,7 @@ const EventoDetalleGrupo = () => {
|
|
|
urlFB: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Facebook")?.id}`,
|
|
|
urlIG: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Instagram")?.id}`,
|
|
|
urlTW: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "Twitter")?.id}`,
|
|
|
+ urlTT: `${REACT_APP_WEB_URL}evento-laud?id=${eventos?.find((e) => e.redSocial === "TikTok")?.id}`,
|
|
|
usuarios: arrUsuarios,
|
|
|
};
|
|
|
|
|
|
@@ -578,6 +601,9 @@ const EventoDetalleGrupo = () => {
|
|
|
if (!eventoTw) {
|
|
|
body.urlTW = "";
|
|
|
}
|
|
|
+ if (!eventoTt) {
|
|
|
+ body.urlTT = "";
|
|
|
+ }
|
|
|
|
|
|
// Buscamos si existe un registro con el ID del evento y la misma plantilla
|
|
|
const q = firebaseQuery(
|
|
|
@@ -1141,10 +1167,10 @@ const EventoDetalleGrupo = () => {
|
|
|
onClick={() =>
|
|
|
history.push(
|
|
|
urlweb +
|
|
|
- "/resultado-grupo-evento?id=" +
|
|
|
- e?.id +
|
|
|
- "&tag=" +
|
|
|
- e?.tag,
|
|
|
+ "/resultado-grupo-evento?id=" +
|
|
|
+ e?.id +
|
|
|
+ "&tag=" +
|
|
|
+ e?.tag,
|
|
|
)
|
|
|
}
|
|
|
icon={<BarChartOutlined />}
|