Log direct messages and keep track of open direct message tabs
This commit is contained in:
parent
e97bb519ed
commit
8305dd561d
17 changed files with 655 additions and 304 deletions
|
@ -29,6 +29,13 @@ function loadState({ store }, env) {
|
|||
});
|
||||
}
|
||||
|
||||
if (env.openDMs) {
|
||||
store.dispatch({
|
||||
type: 'PRIVATE_CHATS',
|
||||
privateChats: env.openDMs
|
||||
});
|
||||
}
|
||||
|
||||
if (env.users) {
|
||||
store.dispatch({
|
||||
type: socketActions.USERS,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Cookie from 'js-cookie';
|
||||
import debounce from 'lodash/debounce';
|
||||
import { getSelectedTab } from 'state/tab';
|
||||
import { isChannel, stringifyTab } from 'utils';
|
||||
import { stringifyTab } from 'utils';
|
||||
import { observe } from 'utils/observe';
|
||||
|
||||
const saveTab = debounce(
|
||||
|
@ -11,7 +11,7 @@ const saveTab = debounce(
|
|||
|
||||
export default function storage({ store }) {
|
||||
observe(store, getSelectedTab, tab => {
|
||||
if (isChannel(tab) || (tab.server && !tab.name)) {
|
||||
if (tab.server) {
|
||||
saveTab(tab);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue