Rename search and days to initialSearch and intitialDays in GraphsPage
This commit is contained in:
parent
672eb20321
commit
dd2e180f9b
@ -11,8 +11,8 @@
|
||||
export let nightMode: boolean;
|
||||
export let graphs: SvelteComponent[];
|
||||
|
||||
export let search: string;
|
||||
export let days: number;
|
||||
export let initialSearch: string;
|
||||
export let initialDays: number;
|
||||
export let controller: SvelteComponent | null;
|
||||
|
||||
const browserSearch = (search: string, query: string) => {
|
||||
@ -30,20 +30,20 @@
|
||||
|
||||
<div class="base">
|
||||
<WithGraphData
|
||||
{search}
|
||||
{days}
|
||||
let:search={searchStore}
|
||||
let:days={daysStore}
|
||||
{initialSearch}
|
||||
{initialDays}
|
||||
let:search
|
||||
let:days
|
||||
let:pending
|
||||
let:loading
|
||||
let:sourceData
|
||||
let:preferences
|
||||
let:revlogRange>
|
||||
{#if controller}
|
||||
<svelte:component this={controller} {i18n} search={searchStore} days={daysStore} {loading} />
|
||||
<svelte:component this={controller} {i18n} {search} {days} {loading} />
|
||||
{/if}
|
||||
|
||||
{#if !pending && sourceData && preferences}
|
||||
{#if !pending}
|
||||
{#each graphs as graph}
|
||||
<svelte:component
|
||||
this={graph}
|
||||
|
@ -32,12 +32,10 @@
|
||||
switch (searchRange as SearchRange) {
|
||||
case SearchRange.Deck:
|
||||
displayedSearch = "deck:current";
|
||||
console.log('search', search)
|
||||
search.set(displayedSearch);
|
||||
break;
|
||||
case SearchRange.Collection:
|
||||
displayedSearch = "";
|
||||
console.log('search', search)
|
||||
search.set(displayedSearch);
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<script lang="typescript">
|
||||
import { onMount } from "svelte";
|
||||
import { writable } from "svelte/store";
|
||||
import useAsync from "./async";
|
||||
import useAsyncReactive from "./asyncReactive";
|
||||
|
@ -4,8 +4,8 @@ interface AsyncReativeData<T, E> {
|
||||
value: Readable<T | null>;
|
||||
error: Readable<E | null>;
|
||||
pending: Readable<boolean>;
|
||||
success: Readable<boolean>;
|
||||
loading: Readable<boolean>;
|
||||
success: Readable<boolean>;
|
||||
}
|
||||
|
||||
function useAsyncReactive<T, E>(
|
||||
|
@ -40,8 +40,8 @@ export function graphs(
|
||||
i18n,
|
||||
graphs,
|
||||
nightMode,
|
||||
search,
|
||||
days,
|
||||
initialSearch: search,
|
||||
initialDays: days,
|
||||
controller,
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user