Skip to content

Commit e0d8eff

Browse files
committed
fix maplist async out of bound error
1 parent 463c8f7 commit e0d8eff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/maplist/ui/Maplist.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ export default class MapList extends PopupWindow<{ page: number, paginator: Pagi
247247
protected async constructContent(login: string, params?: { page: number, list?: readonly tm.Map[] }): Promise<string> {
248248
const maps: readonly Readonly<tm.Map>[] = params?.list ?? maplist.get()
249249
const startIndex: number = (config.rows * config.columns) * ((params?.page ?? 1) - 1)
250-
const mapsToDisplay: number = Math.min(maps.length - startIndex, config.rows * config.columns)
251250
const recordIndexStrings: string[] = await this.getRecordIndexStrings(login, ...maps.slice(startIndex,
252251
(config.rows * config.columns) + startIndex).map(a => a.id))
252+
const mapsToDisplay: number = Math.min(maps.length - startIndex, config.rows * config.columns)
253253
const cell = (i: number, j: number, w: number, h: number): string => {
254254
const gridIndex: number = (i * config.columns) + j
255255
const recordIndexString: string = recordIndexStrings[gridIndex]

0 commit comments

Comments
 (0)