fix inability to map fields from larger to smaller notetype

We were using the new item count instead of the old one.

https://forums.ankiweb.net/t/issue-changing-note-type-on-2-1-45/11822
This commit is contained in:
Damien Elmes 2021-07-31 18:30:50 +10:00
parent cf731c6bad
commit 141a96e221

View file

@ -178,7 +178,8 @@ export class ChangeNotetypeState {
setOldIndex(ctx: MapContext, newIdx: number, oldIdx: number): void {
const list = this.info_.mapForContext(ctx);
const realOldIdx = oldIdx < list.length ? oldIdx : null;
const oldNames = this.info_.getOldNames(ctx);
const realOldIdx = oldIdx < oldNames.length ? oldIdx : null;
const allowDupes = ctx == MapContext.Field;
// remove any existing references?