Added log rocket + analytics to ensure functionality
This commit is contained in:
@@ -5,18 +5,24 @@ import React, { useState } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { DELETE_JOB } from "../../../graphql/jobs.queries";
|
||||
import ipcTypes from "../../../ipc.types";
|
||||
import { setSelectedJobId } from "../../../redux/application/application.actions";
|
||||
const { ipcRenderer } = window;
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setSelectedJobId: (id) => dispatch(setSelectedJobId(id)),
|
||||
});
|
||||
|
||||
export function DeleteJobAtom({ setSelectedJobId, jobId }) {
|
||||
const [deleteJob] = useMutation(DELETE_JOB);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const handleDelete = async () => {
|
||||
setLoading(true);
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
event: "DELETE_JOB",
|
||||
});
|
||||
const result = await deleteJob({
|
||||
variables: { jobId: jobId },
|
||||
});
|
||||
|
||||
@@ -2,13 +2,20 @@ import { useMutation } from "@apollo/client";
|
||||
import { message, Switch } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { UPDATE_JOB_LINE } from "../../../graphql/joblines.queries";
|
||||
const { log } = window;
|
||||
import ipcTypes from "../../../ipc.types";
|
||||
const { log, ipcRenderer } = window;
|
||||
|
||||
export default function IgnoreJobLineAtom({ ignore, lineId }) {
|
||||
export default function IgnoreJobLineAtom({ ignore, lineId, line_desc }) {
|
||||
const [updateJobLine] = useMutation(UPDATE_JOB_LINE);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const handleChange = async (checked) => {
|
||||
setLoading(true);
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
event: "TOGGLE_IGNORE_LINE",
|
||||
line_desc: line_desc,
|
||||
ignore: checked,
|
||||
});
|
||||
|
||||
const result = await updateJobLine({
|
||||
variables: { lineId: lineId, line: { ignore: checked } },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user