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

View File

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