chat, publish: restore sidebar toggler actions

This commit is contained in:
Matilde Park 2020-06-09 16:35:55 -04:00
parent 1b28ea1345
commit b425fb6723
3 changed files with 21 additions and 3 deletions

View File

@ -37,6 +37,7 @@ export default class ChatApi {
this.metadata = {
add: helper.metadataAdd.bind(helper)
};
this.sidebarToggle = helper.sidebarToggle.bind(helper);
}
}
@ -204,5 +205,18 @@ class PrivateHelper extends BaseApi {
});
}
sidebarToggle() {
let sidebarBoolean = true;
if (this.store.state.sidebarShown === true) {
sidebarBoolean = false;
}
this.store.handleEvent({
data: {
local: {
sidebarToggle: sidebarBoolean
}
}
});
}
}

View File

@ -91,10 +91,11 @@ export default class PublishApi extends BaseApi {
if (this.store.state.sidebarShown === true) {
sidebarBoolean = false;
}
this.handleEvent({
type: 'local',
this.store.handleEvent({
data: {
'sidebarToggle': sidebarBoolean
local: {
sidebarToggle: sidebarBoolean
}
}
});
}

View File

@ -2,6 +2,7 @@ import BaseStore from './base';
import ContactReducer from '../reducers/contact-update';
import GroupReducer from '../reducers/group-update';
import LocalReducer from '../reducers/local';
import PublishReducer from '../reducers/publish-update';
import InviteReducer from '../reducers/invite-update';
import PublishResponseReducer from '../reducers/publish-response';
@ -14,6 +15,7 @@ export default class PublishStore extends BaseStore {
this.contactReducer = new ContactReducer();
this.groupReducer = new GroupReducer();
this.localReducer = new LocalReducer();
this.publishReducer = new PublishReducer();
this.inviteReducer = new InviteReducer();
this.responseReducer = new PublishResponseReducer();
@ -38,6 +40,7 @@ export default class PublishStore extends BaseStore {
reduce(data, state) {
this.contactReducer.reduce(data, this.state);
this.groupReducer.reduce(data, this.state);
this.localReducer.reduce(data, this.state);
this.publishReducer.reduce(data, this.state);
this.permissionReducer.reduce(data, this.state);
this.metadataReducer.reduce(data, this.state);