mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-02-19 08:16:34 +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,
|
||||
generation?: number,
|
||||
): IndiInfo {
|
||||
return {
|
||||
id: indi || data.indis[0].id,
|
||||
generation: generation || 0,
|
||||
};
|
||||
// If ID is not given or it doesn't exist in the data, use the first ID in
|
||||
// the data.
|
||||
const id =
|
||||
indi && data.indis.some((i) => i.id === indi) ? indi : data.indis[0].id;
|
||||
return {id, generation: generation || 0};
|
||||
}
|
||||
|
||||
function prepareData(
|
||||
|
||||
Reference in New Issue
Block a user