chore: reformat new code
| @@ -8856,8 +8856,8 @@ export async function processDroppedFiles(files, data = new Map()) { | ||
| 8856 | 8856 | const extension = file.name.split('.').pop().toLowerCase(); |
| 8857 | 8857 | if (allowedMimeTypes.some(x => file.type.startsWith(x)) || allowedExtensions.includes(extension)) { |
| 8858 | 8858 | const preservedName = data instanceof Map && data.get(file); |
| 8859 | 8859 | const avatarFileName = await importCharacter(file, { preserveFileName: preservedName }); |
| 8860 | 8860 | if (avatarFileName !== undefined) { |
| 8861 | 8861 | avatarFileNames.push(avatarFileName); |
| 8862 | 8862 | } |
| 8863 | 8863 | } else { |
| @@ -8865,7 +8865,7 @@ export async function processDroppedFiles(files, data = new Map()) { | ||
| 8865 | 8865 | } |
| 8866 | 8866 | } |
| 8867 | 8867 | |
| 8868 | 8868 | if (avatarFileNames.length > 0) { |
| 8869 | 8869 | await importCharactersTags(avatarFileNames); |
| 8870 | 8870 | selectImportedChar(avatarFileNames[avatarFileNames.length - 1]); |
| 8871 | 8871 | } |
| @@ -8905,7 +8905,7 @@ function selectImportedChar(charId) { | ||
| 8905 | 8905 | * @param {Boolean} [options.importTags=false] Whether to import tags |
| 8906 | 8906 | * @returns {Promise<string>} |
| 8907 | 8907 | */ |
| 8908 | 8908 | async function importCharacter(file, { preserveFileName = '', importTags = false } = {}) { |
| 8909 | 8909 | if (is_group_generating || is_send_press) { |
| 8910 | 8910 | toastr.error(t`Cannot import characters while generating. Stop the request and try again.`, t`Import aborted`); |
| 8911 | 8911 | throw new Error('Cannot import character while generating'); |
| @@ -10830,12 +10830,12 @@ jQuery(async function () { | ||
| 10830 | 10830 | const avatarFileNames = []; |
| 10831 | 10831 | for (const file of e.target.files) { |
| 10832 | 10832 | const avatarFileName = await importCharacter(file); |
| 10833 | 10833 | if (avatarFileName !== undefined) { |
| 10834 | 10834 | avatarFileNames.push(avatarFileName); |
| 10835 | 10835 | } |
| 10836 | 10836 | } |
| 10837 | 10837 | |
| 10838 | 10838 | if (avatarFileNames.length > 0) { |
| 10839 | 10839 | await importCharactersTags(avatarFileNames); |
| 10840 | 10840 | selectImportedChar(avatarFileNames[avatarFileNames.length - 1]); |
| 10841 | 10841 | } |