Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

sort channels

Christian Fei44e11085548c
diff --git a/client/components/channels-list.js b/client/components/channels-list.js
index 6725caf..16d2a01 100644
--- a/client/components/channels-list.js
+++ b/client/components/channels-list.js
@@ -14,7 +14,7 @@ class Channels extends HTMLElement {
attributeChangedCallback(name, _, newValue) {
if (name === 'data-list') {
const channels = newValue.split(',')
- channels.sort()
+ channels.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
const $channelsContainer = this.querySelector('div')
channels.forEach(channel => {
const $existingChannel = $channelsContainer.querySelector(`[data-channel="${channel}"]`)