Fixing ordering random.

This commit is contained in:
Sergiotarxz 2023-10-28 22:12:53 +02:00
parent 4bdfb5bcb6
commit 666097e012

View File

@ -2,7 +2,11 @@
% my $current_category_slug = stash 'current_category_slug';
<nav class="desktop"><%
my @sorted_categories = sort {
$categories->{$a}{priority} <=> $categories->{$b}{priority}
my $result = $categories->{$a}{priority} <=> $categories->{$b}{priority};
if ($result == 0) {
$result = $categories->{$a}{slug} cmp $categories->{$b}{slug};
}
$result;
} keys %$categories;
my $target_category_slug = $current_category_slug;
my $current_category = $categories->{$current_category_slug};