Compare commits
6 Commits
8db9d7ff51
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 516b43a2f8 | |||
| 1b788271a8 | |||
| d2f030f221 | |||
| 5ce70ffa06 | |||
| b1cd2cef8a | |||
| 96a880a4df |
@@ -30,6 +30,12 @@ const NPEDCategoryPopup = () => {
|
|||||||
value: values,
|
value: values,
|
||||||
path: "CategoryPopup",
|
path: "CategoryPopup",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "SAVE",
|
||||||
|
path: "",
|
||||||
|
value: null
|
||||||
|
})
|
||||||
if (result?.reason === "OK") toast.success("Pop up settings saved");
|
if (result?.reason === "OK") toast.success("Pop up settings saved");
|
||||||
dispatch({ type: "NPEDCATENABLED", payload: values });
|
dispatch({ type: "NPEDCATENABLED", payload: values });
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ const SessionCard = () => {
|
|||||||
path: "sessionStats",
|
path: "sessionStats",
|
||||||
value: dedupedSightings,
|
value: dedupedSightings,
|
||||||
});
|
});
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "SAVE",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
if (result.reason === "OK") toast.success("Session saved");
|
if (result.reason === "OK") toast.success("Session saved");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ const SoundSettingsFields = () => {
|
|||||||
path: "soundSettings",
|
path: "soundSettings",
|
||||||
value: updatedValues,
|
value: updatedValues,
|
||||||
});
|
});
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "SAVE",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
if (result.reason !== "OK") {
|
if (result.reason !== "OK") {
|
||||||
toast.error("Cannot update sound settings");
|
toast.error("Cannot update sound settings");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -46,7 +46,11 @@ const SoundUpload = () => {
|
|||||||
if (result.reason !== "OK") {
|
if (result.reason !== "OK") {
|
||||||
toast.error("Cannot update sound settings");
|
toast.error("Cannot update sound settings");
|
||||||
}
|
}
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "SAVE",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
dispatch({ type: "ADD", payload: values });
|
dispatch({ type: "ADD", payload: values });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }:
|
|||||||
const { query, mutation } = useCameraBlackboard();
|
const { query, mutation } = useCameraBlackboard();
|
||||||
|
|
||||||
const hotlistNames = getHotlistName(sighting?.metadata?.hotlistMatches);
|
const hotlistNames = getHotlistName(sighting?.metadata?.hotlistMatches);
|
||||||
const handleAcknowledgeButton = () => {
|
const handleAcknowledgeButton = async () => {
|
||||||
try {
|
try {
|
||||||
if (!sighting) {
|
if (!sighting) {
|
||||||
toast.error("Cannot add sighting to alert list");
|
toast.error("Cannot add sighting to alert list");
|
||||||
@@ -33,17 +33,27 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!query.data.alertHistory) {
|
if (!query.data.alertHistory) {
|
||||||
mutation.mutate({
|
await mutation.mutateAsync({
|
||||||
operation: "INSERT",
|
operation: "INSERT",
|
||||||
path: "alertHistory",
|
path: "alertHistory",
|
||||||
value: [sighting],
|
value: [sighting],
|
||||||
});
|
});
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "SAVE",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
mutation.mutate({
|
await mutation.mutateAsync({
|
||||||
operation: "APPEND",
|
operation: "APPEND",
|
||||||
path: "alertHistory",
|
path: "alertHistory",
|
||||||
value: sighting,
|
value: sighting,
|
||||||
});
|
});
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "SAVE",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
toast.success("Sighting Successfully added to alert list");
|
toast.success("Sighting Successfully added to alert list");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export default function Header() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col lg:flex-row items-center space-x-24 justify-items-center">
|
<div className="flex flex-col lg:flex-row items-center space-x-24 justify-items-center">
|
||||||
<div className="flex flex-row lg:flex-row space-x-2 mx-auto p-2 md:p-0 items-center">
|
<div className="flex flex-row lg:flex-row space-x-2 mx-10 p-2 md:p-0 items-center">
|
||||||
{sessionStarted && sessionPaused ? (
|
{sessionStarted && sessionPaused ? (
|
||||||
<p className="text-gray-400 font-bold">Session Paused</p>
|
<p className="text-gray-400 font-bold">Session Paused</p>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ const SoundBtn = () => {
|
|||||||
path: "soundEnabled",
|
path: "soundEnabled",
|
||||||
value: { enabled: newEnabled },
|
value: { enabled: newEnabled },
|
||||||
});
|
});
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "SAVE",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setEnabled(query?.data?.soundEnabled?.enabled);
|
setEnabled(query?.data?.soundEnabled?.enabled);
|
||||||
@@ -23,10 +28,7 @@ const SoundBtn = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<button onClick={handleClick}>
|
<button onClick={handleClick}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon icon={enabled ? faVolumeHigh : faVolumeXmark} size="2x" />
|
||||||
icon={enabled ? faVolumeHigh : faVolumeXmark}
|
|
||||||
size="2x"
|
|
||||||
/>
|
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ export const IntegrationsProvider = ({ children }: IntegrationsProviderType) =>
|
|||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "Load",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
const result = await mutation.mutateAsync({
|
const result = await mutation.mutateAsync({
|
||||||
operation: "VIEW",
|
operation: "VIEW",
|
||||||
path: "sessionStats",
|
path: "sessionStats",
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ const SoundContextProvider = ({ children }: SoundContextProviderProps) => {
|
|||||||
operation: "VIEW",
|
operation: "VIEW",
|
||||||
path: "soundSettings",
|
path: "soundSettings",
|
||||||
});
|
});
|
||||||
|
await mutation.mutateAsync({
|
||||||
|
operation: "LOAD",
|
||||||
|
path: "",
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
|
|
||||||
if (!result.result || typeof result.result !== "object") {
|
if (!result.result || typeof result.result !== "object") {
|
||||||
dispatch({ type: "UPDATE", payload: state });
|
dispatch({ type: "UPDATE", payload: state });
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ export type CameraConfig = {
|
|||||||
export type CameraBlackBoardOptions = {
|
export type CameraBlackBoardOptions = {
|
||||||
operation?: string;
|
operation?: string;
|
||||||
path?: string;
|
path?: string;
|
||||||
value?: object | string | number | (string | number)[];
|
value?: object | string | number | (string | number)[] | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CameraBlackboardResponse = {
|
export type CameraBlackboardResponse = {
|
||||||
|
|||||||
Reference in New Issue
Block a user