Skip to content

Commit

Permalink
fix(tasks): update ts types
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 committed Dec 19, 2024
1 parent 8aaeac9 commit 052c1c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mapper/src/store/tasks.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ShapeStream, Shape } from '@electric-sql/client';
import type { ShapeData, Row } from '@electric-sql/client';
import type { GeoJSON } from 'geojson';
import type { Feature, FeatureCollection, GeoJSON } from 'geojson';

import type { ProjectTask, TaskEventType } from '$lib/types';

let taskEventShape: Shape;
let featcol = $state({ type: 'FeatureCollection', features: [] });
let featcol: FeatureCollection = $state({ type: 'FeatureCollection', features: [] });
let latestEvent: TaskEventType | null = $state(null);
let events: TaskEventType[] = $state([]);

Expand Down Expand Up @@ -50,7 +50,7 @@ function getTaskStore() {

async function appendTaskStatesToFeatcol(projectTasks: ProjectTask[]) {
const latestTaskStates = await getLatestStatePerTask();
const features = projectTasks.map((task) => ({
const features: Feature[] = projectTasks.map((task) => ({
type: 'Feature',
geometry: task.outline,
properties: {
Expand Down Expand Up @@ -89,7 +89,7 @@ function getTaskStore() {
const allTasksCurrentStates = await getLatestStatePerTask();
selectedTask = allTasksCurrentStates.get(taskId);
selectedTaskState = selectedTask?.state || 'UNLOCKED_TO_MAP';
selectedTaskGeom = featcol.features.find((x) => x.properties.fid === taskId)?.geometry || null;
selectedTaskGeom = featcol.features.find((x) => x?.properties?.fid === taskId)?.geometry || null;
}

return {
Expand Down

0 comments on commit 052c1c7

Please sign in to comment.