summaryrefslogtreecommitdiffstats
path: root/ui/src
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-09 11:35:16 -0700
committerDessalines <tyhou13@gmx.com>2019-04-09 11:35:16 -0700
commit92670d1a5eea86e277d958467684b0632131d6c4 (patch)
tree105a0e2877e749b0a736007a7dc10cc7c7cc6fd9 /ui/src
parent8aa58e479eb742d192a17b7511c0bbce5fc7d534 (diff)
Adding slur filter.
- Fixes #45
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/components/community-form.tsx1
-rw-r--r--ui/src/components/login.tsx2
-rw-r--r--ui/src/components/post-form.tsx2
3 files changed, 4 insertions, 1 deletions
diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx
index b5b222c6..056c29dc 100644
--- a/ui/src/components/community-form.tsx
+++ b/ui/src/components/community-form.tsx
@@ -155,6 +155,7 @@ export class CommunityForm extends Component<CommunityFormProps, CommunityFormSt
if (msg.error) {
alert(msg.error);
this.state.loading = false;
+ this.setState(this.state);
return;
} else if (op == UserOperation.ListCategories){
let res: ListCategoriesResponse = msg;
diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx
index 2443369e..933b08be 100644
--- a/ui/src/components/login.tsx
+++ b/ui/src/components/login.tsx
@@ -97,7 +97,7 @@ export class Login extends Component<any, State> {
<div class="form-group row">
<label class="col-sm-2 col-form-label">Username</label>
<div class="col-sm-10">
- <input type="text" class="form-control" value={this.state.registerForm.username} onInput={linkEvent(this, this.handleRegisterUsernameChange)} required minLength={3} />
+ <input type="text" class="form-control" value={this.state.registerForm.username} onInput={linkEvent(this, this.handleRegisterUsernameChange)} required minLength={3} pattern="[a-zA-Z0-9_]+" />
</div>
</div>
<div class="form-group row">
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx
index 9845a1b1..03ace380 100644
--- a/ui/src/components/post-form.tsx
+++ b/ui/src/components/post-form.tsx
@@ -151,7 +151,9 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
parseMessage(msg: any) {
let op: UserOperation = msgOp(msg);
if (msg.error) {
+ alert(msg.error);
this.state.loading = false;
+ this.setState(this.state);
return;
} else if (op == UserOperation.ListCommunities) {
let res: ListCommunitiesResponse = msg;