mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix flicker when remapping imported notetype field (#2005)
This commit is contained in:
parent
a338271d55
commit
4ea370959b
1 changed files with 12 additions and 1 deletions
|
@ -13,10 +13,21 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
export let columnOptions: ColumnOption[];
|
||||
export let tagsColumn: number;
|
||||
export let globalNotetype: ImportExport.CsvMetadata.MappedNotetype | null;
|
||||
|
||||
let lastNotetypeId: number | undefined = -1;
|
||||
let fieldNamesPromise: Promise<string[]>;
|
||||
|
||||
$: if (globalNotetype?.id !== lastNotetypeId) {
|
||||
lastNotetypeId = globalNotetype?.id;
|
||||
fieldNamesPromise =
|
||||
globalNotetype === null
|
||||
? Promise.resolve([])
|
||||
: getNotetypeFields(globalNotetype.id);
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if globalNotetype}
|
||||
{#await getNotetypeFields(globalNotetype.id) then fieldNames}
|
||||
{#await fieldNamesPromise then fieldNames}
|
||||
{#each fieldNames as label, idx}
|
||||
<!-- first index is treated specially, because it must be assigned some column -->
|
||||
<MapperRow
|
||||
|
|
Loading…
Reference in a new issue