Rename search and days to initialSearch and intitialDays in GraphsPage

This commit is contained in:
Henrik Giesel 2021-03-22 00:04:24 +01:00
parent 672eb20321
commit dd2e180f9b
5 changed files with 12 additions and 13 deletions

View File

@ -11,8 +11,8 @@
export let nightMode: boolean; export let nightMode: boolean;
export let graphs: SvelteComponent[]; export let graphs: SvelteComponent[];
export let search: string; export let initialSearch: string;
export let days: number; export let initialDays: number;
export let controller: SvelteComponent | null; export let controller: SvelteComponent | null;
const browserSearch = (search: string, query: string) => { const browserSearch = (search: string, query: string) => {
@ -30,20 +30,20 @@
<div class="base"> <div class="base">
<WithGraphData <WithGraphData
{search} {initialSearch}
{days} {initialDays}
let:search={searchStore} let:search
let:days={daysStore} let:days
let:pending let:pending
let:loading let:loading
let:sourceData let:sourceData
let:preferences let:preferences
let:revlogRange> let:revlogRange>
{#if controller} {#if controller}
<svelte:component this={controller} {i18n} search={searchStore} days={daysStore} {loading} /> <svelte:component this={controller} {i18n} {search} {days} {loading} />
{/if} {/if}
{#if !pending && sourceData && preferences} {#if !pending}
{#each graphs as graph} {#each graphs as graph}
<svelte:component <svelte:component
this={graph} this={graph}

View File

@ -32,12 +32,10 @@
switch (searchRange as SearchRange) { switch (searchRange as SearchRange) {
case SearchRange.Deck: case SearchRange.Deck:
displayedSearch = "deck:current"; displayedSearch = "deck:current";
console.log('search', search)
search.set(displayedSearch); search.set(displayedSearch);
break; break;
case SearchRange.Collection: case SearchRange.Collection:
displayedSearch = ""; displayedSearch = "";
console.log('search', search)
search.set(displayedSearch); search.set(displayedSearch);
break; break;
} }

View File

@ -1,4 +1,5 @@
<script lang="typescript"> <script lang="typescript">
import { onMount } from "svelte";
import { writable } from "svelte/store"; import { writable } from "svelte/store";
import useAsync from "./async"; import useAsync from "./async";
import useAsyncReactive from "./asyncReactive"; import useAsyncReactive from "./asyncReactive";

View File

@ -4,8 +4,8 @@ interface AsyncReativeData<T, E> {
value: Readable<T | null>; value: Readable<T | null>;
error: Readable<E | null>; error: Readable<E | null>;
pending: Readable<boolean>; pending: Readable<boolean>;
success: Readable<boolean>;
loading: Readable<boolean>; loading: Readable<boolean>;
success: Readable<boolean>;
} }
function useAsyncReactive<T, E>( function useAsyncReactive<T, E>(

View File

@ -40,8 +40,8 @@ export function graphs(
i18n, i18n,
graphs, graphs,
nightMode, nightMode,
search, initialSearch: search,
days, initialDays: days,
controller, controller,
}, },
}); });