fixing not allow unsealed channel type

This commit is contained in:
Roland Osborne 2024-01-03 23:30:35 -08:00
parent 9f1b502d5b
commit 8071db8f35
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import { Modal, Input, List, Button } from 'antd';
import { Modal, Input, List, Button, Tooltip } from 'antd';
import { ChannelsWrapper } from './Channels.styled';
import { CommentOutlined, SearchOutlined } from '@ant-design/icons';
import { useChannels } from './useChannels.hook';
@ -42,7 +42,9 @@ export function Channels({ open, active }) {
</div>
{ state.display !== 'small' && (
<div class="bar">
<Tooltip placement="right" title={ state.allowAdd ? '' : 'Account Sealing Key Required' }>
<Button type="primary" disabled={!state.allowAdd} icon={<CommentOutlined />} onClick={actions.setShowAdd}>New Topic</Button>
</Tooltip>
</div>
)}
<Modal bodyStyle={{ padding: 16 }} title="New Topic" centered visible={state.showAdd && state.allowAdd} footer={null} destroyOnClose={true}

View File

@ -42,7 +42,7 @@ export function useAddChannel() {
try {
updateState({ busy: true });
const cards = Array.from(state.members.values());
if (state.seal) {
if (state.seal || !state.allowUnsealed) {
const keys = [ account.state.sealKey.public ];
cards.forEach(id => {
keys.push(card.state.cards.get(id).data.cardProfile.seal);