1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-24 07:12:57 +00:00

Merge pull request #25 from koloml/feature/consistent-sorting

Sort listing of profiles & tags in profile view alphabetically
This commit is contained in:
2024-08-10 14:42:14 +04:00
committed by GitHub
3 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
<script>
/** @type {import('$lib/extension/entities/MaintenanceProfile.js').default} */
export let profile;
const sortedTagsList = profile.settings.tags.sort((a, b) => a.localeCompare(b));
</script>
<div class="block">
@@ -10,7 +12,7 @@
<div class="block">
<strong>Tags:</strong>
<div class="tags-list">
{#each profile.settings.tags as tagName}
{#each sortedTagsList as tagName}
<span class="tag">{tagName}</span>
{/each}
</div>

View File

@@ -7,7 +7,7 @@
/** @type {import('$lib/extension/entities/MaintenanceProfile.js').default[]} */
let profiles = [];
$: profiles = $maintenanceProfilesStore.sort((a, b) => b.settings.name.localeCompare(a.settings.name));
$: profiles = $maintenanceProfilesStore.sort((a, b) => a.settings.name.localeCompare(b.settings.name));
function resetActiveProfile() {
$activeProfileStore = null;

View File

@@ -28,7 +28,7 @@
if (maybeExistingProfile) {
targetProfile = maybeExistingProfile;
profileName = targetProfile.settings.name;
tagsList = [...targetProfile.settings.tags];
tagsList = [...targetProfile.settings.tags].sort((a, b) => a.localeCompare(b));
} else {
goto('/settings/maintenance');
}