mirror of
https://github.com/balzack/databag.git
synced 2025-02-15 21:19:16 +00:00
more refactor of webapp channel list
This commit is contained in:
parent
b348e38fd1
commit
f1f652bf64
@ -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>
|
||||||
);
|
);
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user