diff --git a/src/index.tsx b/src/index.tsx index 49dbc250..a18708cf 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -42,7 +42,7 @@ setApi(config.routingApi, config.geocodingApi, apiKey || '') const initialCustomModelStr = url.searchParams.get('custom_model') const queryStore = new QueryStore(getApi(), initialCustomModelStr) -const routeStore = new RouteStore(queryStore) +const routeStore = new RouteStore() setStores({ settingsStore: new SettingsStore(), diff --git a/src/sidebar/SettingsBox.tsx b/src/sidebar/SettingsBox.tsx index e503c18f..a4fa72a5 100644 --- a/src/sidebar/SettingsBox.tsx +++ b/src/sidebar/SettingsBox.tsx @@ -76,7 +76,7 @@ function SettingsToggle({ title, enabled, onClick }: { title: string; enabled: b function SettingsCheckbox({ title, enabled, onClick }: { title: string; enabled: boolean; onClick: () => void }) { return (
- {}}> + {}}>
) diff --git a/src/sidebar/search/AddressInput.tsx b/src/sidebar/search/AddressInput.tsx index 1aea0c47..3acfde4f 100644 --- a/src/sidebar/search/AddressInput.tsx +++ b/src/sidebar/search/AddressInput.tsx @@ -293,7 +293,9 @@ class Geocoder { await this.timeout.wait() try { - const options: Record = bias ? { point: coordinateToText(bias), location_bias_scale: "0.5", zoom: "9" } : {} + const options: Record = bias + ? { point: coordinateToText(bias), location_bias_scale: '0.5', zoom: '9' } + : {} const result = await this.api.geocode(query, provider, options) const hits = Geocoder.filterDuplicates(result.hits) if (currentId === this.requestId) this.onSuccess(query, provider, hits) diff --git a/src/stores/RouteStore.ts b/src/stores/RouteStore.ts index d07e136e..32535e75 100644 --- a/src/stores/RouteStore.ts +++ b/src/stores/RouteStore.ts @@ -49,11 +49,8 @@ export default class RouteStore extends Store { } } - private readonly queryStore: QueryStore - - constructor(queryStore: QueryStore) { + constructor() { super(RouteStore.getInitialState()) - this.queryStore = queryStore } reduce(state: RouteStoreState, action: Action): RouteStoreState { diff --git a/test/stores/RouteStore.test.ts b/test/stores/RouteStore.test.ts index 866dca78..6d5f028b 100644 --- a/test/stores/RouteStore.test.ts +++ b/test/stores/RouteStore.test.ts @@ -48,7 +48,7 @@ describe('RouteStore', () => { }) function createStore() { - const store = new RouteStore(new QueryStore(new DummyApi())) + const store = new RouteStore() Dispatcher.register(store) return store }