This commit is contained in:
zeppi 2021-10-13 13:34:23 -04:00 committed by jessopb
parent 6c3ed54d87
commit 11a4524c4c
3 changed files with 16 additions and 9 deletions

View file

@ -40,12 +40,19 @@ function UserChannelFollowIntro(props: Props) {
useEffect(() => {
if (channelsToSubscribe && channelsToSubscribe.length && prefsReady) {
const delayedChannelSubscribe = () => {
channelsToSubscribe.forEach((c) =>
channelSubscribe({
channelName: parseURI(c).claimName,
uri: c,
})
);
channelsToSubscribe.forEach((c) => {
let claimName;
try {
const { claimName: name } = parseURI(c);
claimName = name;
} catch (e) {}
if (claimName) {
channelSubscribe({
channelName: claimName,
uri: c,
});
}
});
};
setTimeout(delayedChannelSubscribe, 1000);
}

View file

@ -44,7 +44,7 @@ function UserFirstChannel(props: Props) {
function handleChannelChange(e) {
const { value } = e.target;
setChannel(value);
if (!isNameValid(value, false)) {
if (!isNameValid(value)) {
setNameError(INVALID_NAME_ERROR);
} else {
setNameError();

View file

@ -36,7 +36,7 @@ type Props = {
claimIsMine: boolean,
claimIsPending: boolean,
isLivestream: boolean,
beginPublish: (string) => void,
beginPublish: (?string) => void,
collectionId: string,
collection: Collection,
collectionUrls: Array<string>,
@ -157,7 +157,7 @@ function ShowPage(props: Props) {
/>
<Button
button="secondary"
onClick={() => push(`/$/${PAGES.REPOST_NEW}?to=${contentName}`)}
onClick={() => push(`/$/${PAGES.REPOST_NEW}${contentName ? `to=${contentName}` : ''}`)}
label={__('Repost Something')}
/>
</div>