Skip to content

Commit

Permalink
Revert hook to js
Browse files Browse the repository at this point in the history
  • Loading branch information
jtklein committed Mar 21, 2024
1 parent 5fed43a commit 3e69978
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { isCurrentUser } from "components/LoginSignUp/AuthenticationService";
import type { Node } from "react";
import React, { useEffect, useState } from "react";
import useAuthenticatedMutation from "sharedHooks/useAuthenticatedMutation";
import { fetchRemoteObservationKey } from "sharedHooks/useRemoteObservation.ts";
import { fetchRemoteObservationKey } from "sharedHooks/useRemoteObservation";

import ActivityHeader from "./ActivityHeader";

Expand Down
2 changes: 1 addition & 1 deletion src/components/ObsDetails/DQAContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
useLocalObservation
} from "sharedHooks";
import useRemoteObservation,
{ fetchRemoteObservationKey } from "sharedHooks/useRemoteObservation.ts";
{ fetchRemoteObservationKey } from "sharedHooks/useRemoteObservation";

const DQAContainer = ( ): React.Node => {
const queryClient = useQueryClient( );
Expand Down
2 changes: 1 addition & 1 deletion src/components/ObsDetails/ObsDetailsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import useObservationsUpdates,
{ fetchObservationUpdatesKey } from "sharedHooks/useObservationsUpdates";
import useRemoteObservation,
{ fetchRemoteObservationKey } from "sharedHooks/useRemoteObservation.ts";
{ fetchRemoteObservationKey } from "sharedHooks/useRemoteObservation";
import useStore from "stores/useStore";

import ObsDetails from "./ObsDetails";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
// @flow
import { fetchRemoteObservation } from "api/observations";
import { RealmContext } from "providers/contexts";
import { useEffect, useMemo } from "react";
import { useEffect, useMemo } from "react";
import Observation from "realmModels/Observation";
import { useAuthenticatedQuery, useCurrentUser, useIsConnected } from "sharedHooks";

const { useRealm } = RealmContext;

export const fetchRemoteObservationKey = "fetchRemoteObservation";

interface UseRemoteObservationReturn {
// TODO: Is there a special type for an observtion from the server?
remoteObservation: Object | null;
refetchRemoteObservation: ( ) => void;
isRefetching: boolean;
fetchRemoteObservationError: Error | null;
}

const useRemoteObservation = ( uuid: string, enabled: boolean ): UseRemoteObservationReturn => {
const useRemoteObservation = ( uuid: string, enabled: boolean ): Object => {
const fetchRemoteObservationQueryKey = useMemo(
( ) => ( [fetchRemoteObservationKey, uuid] ),
[uuid]
Expand Down

0 comments on commit 3e69978

Please sign in to comment.