diff options
author | Dessalines <tyhou13@gmx.com> | 2020-06-27 10:54:08 -0400 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-06-27 10:54:08 -0400 |
commit | e517de5480d07e80fdad545a9eb182198421ac06 (patch) | |
tree | 893073599de7ceaf519bcc02f24f687f9444b347 /ui/src | |
parent | 86dc50f9f0f6ea98273eb3845d5486d2fad8c1ff (diff) | |
parent | bd3051e0583ce8693826abf4e78d8439db366fca (diff) |
Merge branch 'master' into federation
Diffstat (limited to 'ui/src')
-rw-r--r-- | ui/src/components/comment-form.tsx | 21 | ||||
-rw-r--r-- | ui/src/utils.ts | 4 | ||||
-rw-r--r-- | ui/src/version.ts | 2 |
3 files changed, 16 insertions, 11 deletions
diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 0fb7824e..45974cc0 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -245,7 +245,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> { }); } - handleFinished(data: CommentResponse) { + handleFinished(op: UserOperation, data: CommentResponse) { let isReply = this.props.node !== undefined && data.comment.parent_id !== null; let xor = @@ -253,11 +253,16 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> { if ( (data.comment.creator_id == UserService.Instance.user.id && - // If its a reply, make sure parent child match - isReply && - data.comment.parent_id == this.props.node.comment.id) || - // Otherwise, check the XOR of the two - (!isReply && xor) + ((op == UserOperation.CreateComment && + // If its a reply, make sure parent child match + isReply && + data.comment.parent_id == this.props.node.comment.id) || + // Otherwise, check the XOR of the two + (!isReply && xor))) || + // If its a comment edit, only check that its from your user, and that its a + // text edit only + + (op == UserOperation.EditComment && data.comment.content) ) { this.state.previewMode = false; this.state.loading = false; @@ -373,10 +378,10 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> { if (UserService.Instance.user) { if (res.op == UserOperation.CreateComment) { let data = res.data as CommentResponse; - this.handleFinished(data); + this.handleFinished(res.op, data); } else if (res.op == UserOperation.EditComment) { let data = res.data as CommentResponse; - this.handleFinished(data); + this.handleFinished(res.op, data); } } } diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 071b86ac..7bf6fdd1 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -527,7 +527,7 @@ export function pictrsDeleteToast( backgroundColor: backgroundColor, gravity: 'top', position: 'right', - duration: 0, + duration: 10000, onClick: () => { if (toast) { window.location.replace(deleteUrl); @@ -556,7 +556,7 @@ export function messageToastify( close: true, gravity: 'top', position: 'right', - duration: 0, + duration: 5000, onClick: () => { if (toast) { toast.hideToast(); diff --git a/ui/src/version.ts b/ui/src/version.ts index 575b5379..92d18546 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export const version: string = 'v0.7.0'; +export const version: string = 'v0.7.2'; |