chore: reformat new code

2ab59f5a7a157a98ab7bcc83b319b6e740f84f3e

Cohee <18619528+Cohee1207@users.noreply.github.com>

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