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