Skip to content

Commit

Permalink
fix: undo getDevicesWithSensors, because too slow
Browse files Browse the repository at this point in the history
  • Loading branch information
jona159 committed Dec 9, 2023
1 parent 84f1c23 commit e243627
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/routes/explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Map from "~/components/map";
import mapboxglcss from "mapbox-gl/dist/mapbox-gl.css";
import Header from "~/components/header";
import type { LoaderFunctionArgs, LinksFunction } from "@remix-run/node";
import { getDevices, getDevicesWithSensors } from "~/models/device.server";
import { getDevices} from "~/models/device.server";
import type { MapLayerMouseEvent, MapRef } from "react-map-gl";
import { MapProvider, Layer, Source } from "react-map-gl";
import { useState, useRef, useEffect, createContext } from "react";
Expand Down Expand Up @@ -51,8 +51,7 @@ export type DeviceClusterProperties =
>;

export async function loader({ request }: LoaderFunctionArgs) {
const devices = await getDevicesWithSensors();
// const devices = await getDevices();
const devices = await getDevices()

const session = await getUserSession(request);
const message = session.get("global_message") || null;
Expand All @@ -75,9 +74,10 @@ export async function loader({ request }: LoaderFunctionArgs) {

if (user) {
const profile = await getProfileByUserId(user.id);
return typedjson({ devices, user, profile, filteredDevices, phenomena });
return typedjson({ devices, user, profile, filteredDevices, phenomena });
}
return typedjson({

devices,
user,
profile: null,
Expand Down

0 comments on commit e243627

Please sign in to comment.