34 lines
815 B
TypeScript
34 lines
815 B
TypeScript
// Metro module 15482 (f15483).
|
|
import { Endpoints, MAX_MESSAGES_PER_CHANNEL } from "../../Constants";
|
|
import { HTTP } from "../../_bundle/sendRequest";
|
|
import Dispatcher from "../../Dispatcher";
|
|
const r18 = {
|
|
fetchMessages: (a0, a1) => {
|
|
const channelId = a0;
|
|
const around = a1;
|
|
HTTP.get({
|
|
url: Endpoints.MESSAGES(a0),
|
|
query: {
|
|
limit: MAX_MESSAGES_PER_CHANNEL,
|
|
around: a1
|
|
},
|
|
retries: 2,
|
|
oldFormErrors: true,
|
|
rejectWithError: true
|
|
}).then((result) => {
|
|
Dispatcher.dispatch({
|
|
type: "LOAD_MESSAGES_AROUND_SUCCESS",
|
|
channelId,
|
|
messages: result.body,
|
|
around
|
|
});
|
|
});
|
|
},
|
|
clearMessages: () => {
|
|
Dispatcher.dispatch({
|
|
type: "CLEAR_MESSAGES_AROUND_SUCCESS"
|
|
});
|
|
}
|
|
};
|
|
export default r18;
|