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 { ChannelsWrapper } from './Channels.styled';
import { CommentOutlined, SearchOutlined } from '@ant-design/icons'; import { CommentOutlined, SearchOutlined } from '@ant-design/icons';
import { useChannels } from './useChannels.hook'; import { useChannels } from './useChannels.hook';
@ -42,7 +42,9 @@ export function Channels({ open, active }) {
</div> </div>
{ state.display !== 'small' && ( { state.display !== 'small' && (
<div class="bar"> <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> <Button type="primary" disabled={!state.allowAdd} icon={<CommentOutlined />} onClick={actions.setShowAdd}>New Topic</Button>
</Tooltip>
</div> </div>
)} )}
<Modal bodyStyle={{ padding: 16 }} title="New Topic" centered visible={state.showAdd && state.allowAdd} footer={null} destroyOnClose={true} <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 { try {
updateState({ busy: true }); updateState({ busy: true });
const cards = Array.from(state.members.values()); const cards = Array.from(state.members.values());
if (state.seal) { if (state.seal || !state.allowUnsealed) {
const keys = [ account.state.sealKey.public ]; const keys = [ account.state.sealKey.public ];
cards.forEach(id => { cards.forEach(id => {
keys.push(card.state.cards.get(id).data.cardProfile.seal); keys.push(card.state.cards.get(id).data.cardProfile.seal);