Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop' of github.com:ZbayApp/zbay into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jk authored and jk committed Aug 4, 2020
2 parents 8dff736 + 2426775 commit a31cf33
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ Ubuntu18 ```npm run distUbuntu18```
The built installers can then be found in the `dist` folder.
## Custom protocol support (Only Linux)

To be able to take advantage of zbay protocol on linux (Other platforms work by default) you need to create Desktop Entry.
You can find template file in repository ```zbay.desktop```. You need to change ```Exec=/path/to/zbay/Zbay-version.AppImage``` inside ```zbay.desktop``` to match your path to Zbay AppImage file.
Then place file inside ```~/.local/share/applications/``` folder and run command to register new entry ```xdg-mime default zbay.desktop x-scheme-handler/zbay```
To be able to open Zbay links on Linux you will, for the time being, need to create a "Desktop Entry".

1. Find the ```zbay.desktop``` template file in the repository.
2. Open ```zbay.desktop``` and change ```Exec=/path/to/zbay/Zbay-version.AppImage``` inside to match the path to your Zbay AppImage file.
3. Place the file inside the ```~/.local/share/applications/``` folder and run the following command to register the new entry: ```xdg-mime default zbay.desktop x-scheme-handler/zbay```

## Managing keys

Expand Down
6 changes: 4 additions & 2 deletions src/renderer/components/ui/PublishChannelModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export const formSchema = publicChannels =>
'testFormat',
'Channel name can contain only small characters and up to one hyphen.',
function (value) {
return parseChannelName(value).match(/^[a-z0-9]+([\s-][a-z0-9]+){0,}$/)
return parseChannelName(value).match(
/^[a-z0-9]+([\s-][a-z0-9]+){0,}$/
)
}
)
.validateName(publicChannels)
Expand Down Expand Up @@ -235,7 +237,7 @@ export const PublishChannelModal = ({
/>
</Grid>
<div className={classes.gutter}>
{showParsedMessage(values.name) && (
{showParsedMessage(values.name) && isValid && (
<Grid container alignItems='center' direction='row'>
<Grid item className={classes.iconDiv}>
<WarningIcon className={classes.warrningIcon} />
Expand Down
7 changes: 5 additions & 2 deletions src/renderer/components/widgets/channels/CreateChannelForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ const styles = theme => ({
}
})
export const parseChannelName = (name = '') => {
return name.toLowerCase().replace(/ +/g, '-').replace(/-+/g, '-')
return name
.toLowerCase()
.replace(/ +/g, '-')
.replace(/-+/g, '-')
}
export const formSchema = Yup.object().shape({
name: Yup.string()
Expand Down Expand Up @@ -100,7 +103,7 @@ export const CreateChannelForm = ({ classes, onSubmit, setStep }) => (
placeholder='my-channel'
/>
<div className={classes.gutter}>
{showParsedMessage(values.name) && (
{showParsedMessage(values.name) && isValid && (
<Grid container alignItems='center' direction='row'>
<Grid item className={classes.iconDiv}>
<WarningIcon className={classes.warrningIcon} />
Expand Down

0 comments on commit a31cf33

Please sign in to comment.