2021-07-28 15:15:52 +02:00
|
|
|
import appDispatcher from '../dispatcher';
|
|
|
|
import cons from '../state/cons';
|
|
|
|
|
|
|
|
function handleTabChange(tabId) {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.CHANGE_TAB,
|
|
|
|
tabId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function selectRoom(roomId) {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.SELECT_ROOM,
|
|
|
|
roomId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function togglePeopleDrawer() {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.TOGGLE_PEOPLE_DRAWER,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function openInviteList() {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_INVITE_LIST,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-08 11:15:21 +02:00
|
|
|
function openPublicChannels(searchTerm) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_PUBLIC_CHANNELS,
|
2021-08-08 11:15:21 +02:00
|
|
|
searchTerm,
|
2021-07-28 15:15:52 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function openCreateChannel() {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_CREATE_CHANNEL,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-08 06:53:26 +02:00
|
|
|
function openInviteUser(roomId, searchTerm) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_INVITE_USER,
|
|
|
|
roomId,
|
2021-08-08 06:53:26 +02:00
|
|
|
searchTerm,
|
2021-07-28 15:15:52 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function openSettings() {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_SETTINGS,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-14 06:49:29 +02:00
|
|
|
function openEmojiBoard(cords, requestEmojiCallback) {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_EMOJIBOARD,
|
|
|
|
cords,
|
|
|
|
requestEmojiCallback,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-16 14:07:29 +02:00
|
|
|
function openReadReceipts(roomId, eventId) {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_READRECEIPTS,
|
|
|
|
roomId,
|
|
|
|
eventId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-07-28 15:15:52 +02:00
|
|
|
export {
|
|
|
|
handleTabChange,
|
|
|
|
selectRoom,
|
|
|
|
togglePeopleDrawer,
|
|
|
|
openInviteList,
|
|
|
|
openPublicChannels,
|
|
|
|
openCreateChannel,
|
|
|
|
openInviteUser,
|
|
|
|
openSettings,
|
2021-08-14 06:49:29 +02:00
|
|
|
openEmojiBoard,
|
2021-08-16 14:07:29 +02:00
|
|
|
openReadReceipts,
|
2021-07-28 15:15:52 +02:00
|
|
|
};
|