summaryrefslogtreecommitdiff
path: root/ui/lib/store/channels.js
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-11-03 21:47:30 -0500
committerOwen Jacobson <owen@grimoire.ca>2024-11-03 21:47:30 -0500
commit65381f49cc9abce98c1c63c399fdcfc8ce76c3f5 (patch)
treee0b1eea57aa8b431aa83e2efc4577c12d3cc2b29 /ui/lib/store/channels.js
parent30fa0c4c1faece6b054105fe3cce5107f24a2fa2 (diff)
parentf38881f3253b3a128154ffd95655859e3dc629dc (diff)
Merge remote-tracking branch 'origin/wip/actually-configure-prettier'
Diffstat (limited to 'ui/lib/store/channels.js')
-rw-r--r--ui/lib/store/channels.js60
1 files changed, 30 insertions, 30 deletions
diff --git a/ui/lib/store/channels.js b/ui/lib/store/channels.js
index b57ca7e..37dc673 100644
--- a/ui/lib/store/channels.js
+++ b/ui/lib/store/channels.js
@@ -1,36 +1,36 @@
export class Channels {
- constructor() {
- this.channels = [];
- }
+ constructor() {
+ this.channels = [];
+ }
- setChannels(channels) {
- this.channels = [...channels];
- this.sort();
- return this;
- }
+ setChannels(channels) {
+ this.channels = [...channels];
+ this.sort();
+ return this;
+ }
- addChannel(id, name) {
- this.channels = [...this.channels, { id, name }];
- 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;
- }
+ 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;
- });
- }
+ sort() {
+ this.channels.sort((a, b) => {
+ if (a.name < b.name) {
+ return -1;
+ } else if (a.name > b.name) {
+ return 1;
+ }
+ return 0;
+ });
+ }
}