Skip to content

Commit 9c65270

Browse files
committed
can just call load()
1 parent 21402b3 commit 9c65270

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

resources/js/chat/chat-state-store.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@ export default class ChatStateStore implements DispatchListener {
110110
}
111111

112112
runInAction(() => {
113-
// TODO: use selectChannel?
114-
if (typeof this.selected === 'number') {
115-
this.channelStore.loadChannel(this.selected);
116-
}
113+
this.selectedChannel?.load();
117114

118115
this.isReady = true;
119116
});
@@ -207,7 +204,7 @@ export default class ChatStateStore implements DispatchListener {
207204
this.refocusToIndex = this.channelList.indexOf(channel);
208205

209206
// TODO: should this be here or have something else figure out if channel needs to be loaded?
210-
this.channelStore.loadChannel(channelId);
207+
channel.load();
211208

212209
this.updateUrl(channel, mode);
213210
}

resources/js/stores/channel-store.ts

-6
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ export default class ChannelStore implements DispatchListener {
125125
}
126126
}
127127

128-
// TODO: load is async, needs to be reflected somewhere.
129-
@action
130-
loadChannel(channelId: number) {
131-
this.channels.get(channelId)?.load();
132-
}
133-
134128
@action
135129
loadChannelEarlierMessages(channelId: number) {
136130
this.get(channelId)?.loadEarlierMessages();

0 commit comments

Comments
 (0)