mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-04 13:19:48 +03:00
Merge pull request #5632 from urbit/po/handle-unsigged-group-links-in-join
groups: handle unsigged group links in join
This commit is contained in:
commit
884799a2ce
@ -229,6 +229,18 @@ export function deSig(ship: string): string {
|
||||
return ship.replace('~', '');
|
||||
}
|
||||
|
||||
export function preSig(ship: string): string {
|
||||
if (!ship) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (ship.trim().startsWith('~')) {
|
||||
return ship.trim();
|
||||
}
|
||||
|
||||
return '~'.concat(ship.trim());
|
||||
}
|
||||
|
||||
export function uxToHex(ux: string) {
|
||||
if (ux.length > 2 && ux.substr(0, 2) === '0x') {
|
||||
const value = ux.substr(2).replace('.', '').padStart(6, '0');
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
Button,
|
||||
ManagedTextInputField,
|
||||
ManagedCheckboxField,
|
||||
ContinuousProgressBar,
|
||||
ContinuousProgressBar
|
||||
} from '@tlon/indigo-react';
|
||||
import { Formik, Form } from 'formik';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
@ -20,6 +20,7 @@ import airlock from '~/logic/api';
|
||||
import { joinError, joinLoad, JoinProgress } from '@urbit/api';
|
||||
import { useQuery } from '~/logic/lib/useQuery';
|
||||
import { JoinKind, JoinDesc, JoinSkeleton } from './Skeleton';
|
||||
import { preSig } from '~/logic/lib/util';
|
||||
|
||||
interface InviteWithUid extends Invite {
|
||||
uid: string;
|
||||
@ -32,7 +33,7 @@ interface FormSchema {
|
||||
|
||||
const initialValues = {
|
||||
autojoin: false,
|
||||
shareContact: false,
|
||||
shareContact: false
|
||||
};
|
||||
|
||||
function JoinForm(props: {
|
||||
@ -173,7 +174,6 @@ function JoinError(props: {
|
||||
useGroupState.getState().abortJoin(desc.group);
|
||||
dismiss();
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<JoinSkeleton modal={modal} title={title} desc={desc}>
|
||||
@ -272,7 +272,7 @@ export function JoinPrompt(props: JoinPromptProps) {
|
||||
};
|
||||
|
||||
const onSubmit = async ({ link }: PromptFormSchema) => {
|
||||
const path = `/ship/${link}`;
|
||||
const path = `/ship/${preSig(link)}`;
|
||||
history.push({
|
||||
search: appendQuery({ 'join-path': path })
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user