u
This commit is contained in:
@@ -40,7 +40,7 @@ import { setting as settingApi } from '../../api';
|
||||
import chatAutomat, {
|
||||
selectPendingAskUser,
|
||||
} from '../../automats/chatAutomat';
|
||||
import userSettingsAutomat from '../../automats/userSettingsAutomat';
|
||||
import companyAutomat from '../../automats/companyAutomat';
|
||||
import vfsAutomat from '../../automats/vfsAutomat';
|
||||
import { VfsEditorPanel, VfsFileIcon } from '../vfs';
|
||||
import ChatFlowList from './ChatFlowList';
|
||||
@@ -130,7 +130,7 @@ export default class ChatDrawer extends PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const s = chatAutomat.state;
|
||||
const settings = userSettingsAutomat.state;
|
||||
const settings = companyAutomat.state;
|
||||
const vfs = vfsAutomat.state;
|
||||
this.state = {
|
||||
isOpen: s.isOpen,
|
||||
@@ -293,12 +293,12 @@ export default class ChatDrawer extends PureComponent {
|
||||
return patch;
|
||||
});
|
||||
|
||||
this.unsubSettings = userSettingsAutomat.subscribe(this, (state) => {
|
||||
this.unsubSettings = companyAutomat.subscribe(this, (state) => {
|
||||
if (!this.state.isResizing) {
|
||||
return { drawerWidth: state.chatDrawerWidth || DEFAULT_DRAWER_WIDTH };
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}, ['chatDrawerWidth']);
|
||||
|
||||
this.unsubVfs = vfsAutomat.subscribe(this, (state) => ({
|
||||
isVfsOpen: state.isOpen,
|
||||
@@ -465,7 +465,7 @@ export default class ChatDrawer extends PureComponent {
|
||||
|
||||
this.setState({ isResizing: false });
|
||||
vfsAutomat.actions.setVfsWidth(currentVfsWidth);
|
||||
userSettingsAutomat.actions.setChatDrawerWidth(currentChatWidth);
|
||||
companyAutomat.actions.setChatDrawerWidth(currentChatWidth);
|
||||
};
|
||||
|
||||
window.addEventListener('pointermove', onMove, { passive: false });
|
||||
@@ -531,7 +531,7 @@ export default class ChatDrawer extends PureComponent {
|
||||
if (isVfs) {
|
||||
vfsAutomat.actions.setVfsWidth(currentVfsWidth);
|
||||
} else {
|
||||
userSettingsAutomat.actions.setChatDrawerWidth(currentChatWidth);
|
||||
companyAutomat.actions.setChatDrawerWidth(currentChatWidth);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -546,7 +546,7 @@ export default class ChatDrawer extends PureComponent {
|
||||
|
||||
handleResizeDoubleClick = () => {
|
||||
this.setState({ drawerWidth: DEFAULT_DRAWER_WIDTH });
|
||||
userSettingsAutomat.actions.setChatDrawerWidth(DEFAULT_DRAWER_WIDTH);
|
||||
companyAutomat.actions.setChatDrawerWidth(DEFAULT_DRAWER_WIDTH);
|
||||
};
|
||||
|
||||
cleanupResizeListeners = () => {
|
||||
|
||||
Reference in New Issue
Block a user