From: Dessalines Date: Fri, 6 Mar 2020 19:57:52 +0000 (-0500) Subject: Ask for confirmation on leaving pages with incomplete forms. Fixes #529 X-Git-Url: http://these/git/%7B%27/docs/%7BfrontRss%7D?a=commitdiff_plain;h=a67a69f95e268a679a6c42722240628019355790;p=lemmy.git Ask for confirmation on leaving pages with incomplete forms. Fixes #529 --- diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index aa8e651d..f3009d34 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -1,4 +1,5 @@ import { Component, linkEvent } from 'inferno'; +import { Prompt } from 'inferno-router'; import { CommentNode as CommentNodeI, CommentForm as CommentFormI, @@ -87,6 +88,10 @@ export class CommentForm extends Component { render() { return (
+
diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx index aaa3e6c4..eedc2003 100644 --- a/ui/src/components/community-form.tsx +++ b/ui/src/components/community-form.tsx @@ -1,4 +1,5 @@ import { Component, linkEvent } from 'inferno'; +import { Prompt } from 'inferno-router'; import { Subscription } from 'rxjs'; import { retryWhen, delay, take } from 'rxjs/operators'; import { @@ -105,120 +106,131 @@ export class CommunityForm extends Component< render() { return ( - -
- -
- + <> + + +
+ +
+ +
-
-
- -
- -
-
-
- -
-