more refactor of webapp channel list

This commit is contained in:
Roland Osborne 2023-01-19 00:12:32 -08:00
parent b348e38fd1
commit f1f652bf64
2 changed files with 6 additions and 14 deletions

View File

@ -14,10 +14,6 @@ export function Channels({ open, active }) {
open(id); open(id);
}; };
const cancelled = () => {
actions.clearShowAdd();
}
return ( return (
<ChannelsWrapper> <ChannelsWrapper>
<div class="search"> <div class="search">
@ -49,8 +45,9 @@ export function Channels({ open, active }) {
<Button type="primary" icon={<CommentOutlined />} onClick={actions.setShowAdd}>New Topic</Button> <Button type="primary" icon={<CommentOutlined />} onClick={actions.setShowAdd}>New Topic</Button>
</div> </div>
)} )}
<Modal title="New Topic" centered visible={state.showAdd} footer={null}> <Modal title="New Topic" centered visible={state.showAdd} footer={null} destroyOnClose={true}
<AddChannel added={added} cancelled={cancelled} /> onCancel={actions.clearShowAdd}>
<AddChannel added={added} cancelled={actions.clearShowAdd} />
</Modal> </Modal>
</ChannelsWrapper> </ChannelsWrapper>
); );

View File

@ -125,6 +125,7 @@ export function useChannels() {
item.subject = null; item.subject = null;
} }
} }
if (item.subject == null || typeof item.subject !== 'string') { if (item.subject == null || typeof item.subject !== 'string') {
item.subject = item.label; item.subject = item.label;
} }
@ -178,10 +179,7 @@ export function useChannels() {
if (!item) { if (!item) {
item = { cardId, channelId }; item = { cardId, channelId };
} }
if (item.detailRevision !== detailRevision || syncChannelDetail(item, cardValue, channelValue);
item.sealKey !== sealKey) {
syncChannelDetail(item, cardValue, channelValue);
}
if (item.topicRevision !== topicRevision || if (item.topicRevision !== topicRevision ||
item.sealKey !== sealKey) { item.sealKey !== sealKey) {
syncChannelSummary(item, channelValue); syncChannelSummary(item, channelValue);
@ -204,10 +202,7 @@ export function useChannels() {
if (!item) { if (!item) {
item = { channelId }; item = { channelId };
} }
if (item.detailRevision !== detailRevision || syncChannelDetail(item, null, channelValue);
item.sealKey !== sealKey) {
syncChannelDetail(item, null, channelValue);
}
if (item.topicRevision !== topicRevision || if (item.topicRevision !== topicRevision ||
item.sealKey !== sealKey) { item.sealKey !== sealKey) {
syncChannelSummary(item, channelValue); syncChannelSummary(item, channelValue);