mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 23:26:15 +00:00
WikiTree: Make it work when passing numeric WikiTree ID instead of name
This commit is contained in:
@@ -10,10 +10,11 @@ export function getSelection(
|
|||||||
indi?: string,
|
indi?: string,
|
||||||
generation?: number,
|
generation?: number,
|
||||||
): IndiInfo {
|
): IndiInfo {
|
||||||
return {
|
// If ID is not given or it doesn't exist in the data, use the first ID in
|
||||||
id: indi || data.indis[0].id,
|
// the data.
|
||||||
generation: generation || 0,
|
const id =
|
||||||
};
|
indi && data.indis.some((i) => i.id === indi) ? indi : data.indis[0].id;
|
||||||
|
return {id, generation: generation || 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepareData(
|
function prepareData(
|
||||||
|
|||||||
Reference in New Issue
Block a user