summaryrefslogtreecommitdiff
path: root/ui/lib/store/channels.js
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2024-12-03 13:44:05 -0500
committerKit La Touche <kit@transneptune.net>2024-12-03 13:44:05 -0500
commitc6fbd21c27277dd76c4dbabf5f1bf24f58142a1a (patch)
tree94392c1cafc88e91b14ebbb5a1e39eb86df41bc8 /ui/lib/store/channels.js
parentd89d64a1bd71bbb0f545818794f574fc80046c0f (diff)
parent4e3ad13aca163e733724b205c250bdb67cc56c29 (diff)
Merge branch 'main' into wip/stylize
Diffstat (limited to 'ui/lib/store/channels.js')
-rw-r--r--ui/lib/store/channels.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/ui/lib/store/channels.js b/ui/lib/store/channels.js
deleted file mode 100644
index 37dc673..0000000
--- a/ui/lib/store/channels.js
+++ /dev/null
@@ -1,36 +0,0 @@
-export class Channels {
- constructor() {
- this.channels = [];
- }
-
- setChannels(channels) {
- this.channels = [...channels];
- this.sort();
- return this;
- }
-
- addChannel(id, name) {
- this.channels = [...this.channels, { id, name }];
- this.sort();
- return this;
- }
-
- deleteChannel(id) {
- const channelIndex = this.channels.map((e) => e.id).indexOf(id);
- if (channelIndex !== -1) {
- this.channels.splice(channelIndex, 1);
- }
- return this;
- }
-
- sort() {
- this.channels.sort((a, b) => {
- if (a.name < b.name) {
- return -1;
- } else if (a.name > b.name) {
- return 1;
- }
- return 0;
- });
- }
-}