mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-01 10:55:45 +03:00
Add trailing slash to bait server automatically
This commit is contained in:
parent
e01bce5770
commit
eac009eeb4
@ -29,7 +29,7 @@ export const InvitePrefs = () => {
|
||||
id="url"
|
||||
type="text"
|
||||
defaultValue={baitURL}
|
||||
{...register('url', { pattern: /^http.*\/$/ })}
|
||||
{...register('url', { pattern: /^http.*$/ })}
|
||||
className="input default-ring bg-gray-50"
|
||||
/>
|
||||
</div>
|
||||
|
@ -35,11 +35,13 @@ export default function useInviteState() {
|
||||
setBaitURL: setBaitURL,
|
||||
loaded: loaded,
|
||||
save: async (data: {url: string}) => {
|
||||
const fixedUrl = data.url.substr(-1) === '/' ? data.url : data.url + '/';
|
||||
|
||||
await api.poke({
|
||||
app: 'reel',
|
||||
mark: 'reel-command',
|
||||
json: {
|
||||
url: data.url,
|
||||
url: fixedUrl,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user