File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import {EVENT_FILES_DIR, pullEventFiles} from './git.ts';
33import { typedEntries } from './javascript-helper.ts' ;
44import type { EventDirectory , EventId } from './types.ts' ;
55
6- const DIRECTORY_FILE = `${ EVENT_FILES_DIR } /directory.json` ;
7-
86let directory : EventDirectory = { } ;
97let namesOfEvents : Readonly < Record < EventId , string > > = { } ;
108
@@ -14,7 +12,10 @@ console.log(new Date(), 'eventfiles loaded');
1412
1513async function update ( ) {
1614 await pullEventFiles ( ) ;
17- const directoryString = await readFile ( DIRECTORY_FILE , 'utf8' ) ;
15+ const directoryString = await readFile (
16+ `${ EVENT_FILES_DIR } /directory.json` ,
17+ 'utf8' ,
18+ ) ;
1819 directory = JSON . parse ( directoryString ) as EventDirectory ;
1920 namesOfEvents = await generateMapping ( ) ;
2021}
Original file line number Diff line number Diff line change @@ -71,7 +71,10 @@ export function generateShortChangeText(
7171
7272export async function loadEvents ( eventId : EventId ) : Promise < EventEntry [ ] > {
7373 try {
74- const content = await readFile ( `${ EVENT_FILES_DIR } /events/${ eventId } .json` , 'utf8' ) ;
74+ const content = await readFile (
75+ `${ EVENT_FILES_DIR } /events/${ eventId } .json` ,
76+ 'utf8' ,
77+ ) ;
7578 return JSON . parse ( content ) as EventEntry [ ] ;
7679 } catch ( error ) {
7780 console . error ( 'ERROR while loading events for change date picker' , error ) ;
Original file line number Diff line number Diff line change @@ -19,9 +19,6 @@ import {BACK_BUTTON_TEXT} from '../../lib/inline-menu.ts';
1919import { typedEntries } from '../../lib/javascript-helper.ts' ;
2020import type { EventId , MyContext } from '../../lib/types.ts' ;
2121
22- const MAX_RESULT_ROWS = 10 ;
23- const RESULT_COLUMNS = 1 ;
24-
2522export const bot = new Composer < MyContext > ( ) ;
2623export const menu = new MenuTemplate < MyContext > ( ctx => {
2724 ctx . session . eventAdd ??= { path : [ ] } ;
@@ -102,8 +99,8 @@ menu.interact('filter-clear', {
10299} ) ;
103100
104101menu . choose ( 'list' , {
105- maxRows : MAX_RESULT_ROWS ,
106- columns : RESULT_COLUMNS ,
102+ maxRows : 10 ,
103+ columns : 1 ,
107104 choices ( ctx ) {
108105 try {
109106 ctx . session . eventAdd ??= { path : [ ] } ;
You can’t perform that action at this time.
0 commit comments