mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
channel: name group DMs a comma-separated list of participants
fixes urbit/landscape#623
This commit is contained in:
parent
ce74572d02
commit
1300c5b923
@ -53,8 +53,22 @@ export function NewChannel(props: NewChannelProps): ReactElement {
|
||||
const groups = useGroupState(state => state.groups);
|
||||
const waiter = useWaitForProps({ groups }, 5000);
|
||||
|
||||
const channelName = (values) => {
|
||||
if (values.name)
|
||||
return value.name;
|
||||
if (!values.name && workspace?.type === 'messages') {
|
||||
const joinedShips = values.ships
|
||||
.filter(Boolean)
|
||||
.map(ship => `~${deSig(ship)}`)
|
||||
.join(', ')
|
||||
.concat(`, ~${deSig(window.ship)}`);
|
||||
return joinedShips;
|
||||
}
|
||||
return values.moduleType;
|
||||
};
|
||||
|
||||
const onSubmit = async (values: FormSchema, actions) => {
|
||||
const name = values.name ? values.name : values.moduleType;
|
||||
const name = channelName(values);
|
||||
const resId: string =
|
||||
stringToSymbol(values.name) +
|
||||
(workspace?.type !== 'messages'
|
||||
|
Loading…
Reference in New Issue
Block a user