Skip to content

Commit

Permalink
Merge pull request #131 from tloncorp/ns/automatic-trailing-slash
Browse files Browse the repository at this point in the history
Add trailing slash to bait server automatically
  • Loading branch information
arthyn authored Mar 30, 2023
2 parents b6c3127 + eac009e commit cc19e18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/src/preferences/InvitePrefs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 3 additions & 1 deletion ui/src/state/invites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,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,
}
})
}
Expand Down

0 comments on commit cc19e18

Please sign in to comment.