Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronPlave committed Mar 25, 2024
1 parent c87c9d6 commit a8ff7d7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/routes/plans/[id]/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<svelte:options immutable={true} />

<script lang="ts">
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
Expand All @@ -12,7 +13,7 @@
import WaterfallIcon from '@nasa-jpl/stellar/icons/waterfall.svg?component';
import GearWideConnectedIcon from 'bootstrap-icons/icons/gear-wide-connected.svg?component';
import { keyBy } from 'lodash-es';
import { onDestroy, onMount } from 'svelte';
import { onDestroy } from 'svelte';
import Nav from '../../../components/app/Nav.svelte';
import PageTitle from '../../../components/app/PageTitle.svelte';
import Console from '../../../components/console/Console.svelte';
Expand Down Expand Up @@ -225,7 +226,7 @@
featurePermissions.schedulingGoalsPlanSpec.canAnalyze(data.user, $plan, $plan.model) && !$planReadOnly;
hasSimulatePermission = featurePermissions.simulation.canRun(data.user, $plan, $plan.model) && !$planReadOnly;
}
if (data.initialPlan) {
$: if (data.initialPlan) {
$plan = data.initialPlan;
$planEndTimeMs = getUnixEpochTime(data.initialPlan.end_time_doy);
$planStartTimeMs = getUnixEpochTime(data.initialPlan.start_time_doy);
Expand Down Expand Up @@ -385,15 +386,13 @@
response => response.errors?.length,
).length;
onMount(() => {
if ($plan) {
// Asynchronously fetch resource types
effects.getResourceTypes($plan.model_id, data.user).then(initialResourceTypes => {
$resourceTypes = initialResourceTypes;
$resourceTypesLoading = false;
});
}
});
$: if ($plan && browser) {
// Asynchronously fetch resource types
effects.getResourceTypes($plan.model_id, data.user).then(initialResourceTypes => {
$resourceTypes = initialResourceTypes;
$resourceTypesLoading = false;
});
}
onDestroy(() => {
resetActivityStores();
Expand Down

0 comments on commit a8ff7d7

Please sign in to comment.