Skip to content

Commit

Permalink
fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoertl committed Jan 2, 2024
1 parent fe50a6f commit ccf0d09
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/composables/useKeywordInContextSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function useKeywordInContextSearch() {
// console.log('keywordInContext', { keywordInContext: keywordInContext.value });
// eslint-disable require-atomic-updates
// @ts-ignore
query.data.keywordInContext = keywordInContext.Lines.map(
query.data.keywordInContext = (keywordInContext.Lines || []).map(
({ Tbl_refs, Left, Kwic, toknum, Right }) => ({
// this mapping is directly taken from the ancient code
refs: Tbl_refs,
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useMediaSourceSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function useMediaSourceSearch() {
//q: `${query.preparedQuery};${corpora.corporaForSearch};fttattr=doc.docsrc;fcrit=doc.id;flimit=0;format=json`,
},
});
if (!mediaSources?.value) {
if (!mediaSources?.value || mediaSources?.value.Blocks) {
query.loading.mediaSources = false;
return console.error("error on MediaSources");
}
Expand Down
3 changes: 2 additions & 1 deletion src/composables/useYearlyFrequenciesSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export function useYearlyFrequenciesSearch() {
});
// console.log({ freqttYear: freqttYear.value });
const freqttYear = _freqttYear.value as YearlyFrequencyData;
const yearlyData = freqttYear.Blocks[0]?.Items ?? [];
const _yearlyData = freqttYear.Blocks ?? [];
const yearlyData = _yearlyData[0]?.Items ?? [];
// console.log({ yearlyData, blocks: freqttYear.value.Blocks, items: freqttYear.value.Blocks[0].Items });
// console.log('data', query.data);

Expand Down

0 comments on commit ccf0d09

Please sign in to comment.