diff options
| author | jacob1 <jfu614@gmail.com> | 2012-12-16 03:55:53 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2012-12-16 03:55:53 (GMT) |
| commit | 462bd7bdf914b2663c7e574a0bf4de6d4a8a723c (patch) | |
| tree | f1a4cc6e981400254a65ebd209179be5810cec86 /src/preview/PreviewController.cpp | |
| parent | 1ef507d9e60348ed03f2edcd9c8d78d28d8d9d6f (diff) | |
| download | powder-462bd7bdf914b2663c7e574a0bf4de6d4a8a723c.zip powder-462bd7bdf914b2663c7e574a0bf4de6d4a8a723c.tar.gz | |
fix comments being deleted when hitting enter and opening a save or getting an error when commenting
Diffstat (limited to 'src/preview/PreviewController.cpp')
| -rw-r--r-- | src/preview/PreviewController.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/preview/PreviewController.cpp b/src/preview/PreviewController.cpp index 89e3ca6..37561b7 100644 --- a/src/preview/PreviewController.cpp +++ b/src/preview/PreviewController.cpp @@ -84,24 +84,27 @@ void PreviewController::Update() } } -void PreviewController::SubmitComment(std::string comment) +bool PreviewController::SubmitComment(std::string comment) { if(comment.length() < 4) { new ErrorMessage("Error", "Comment is too short"); + return false; } else { RequestStatus status = Client::Ref().AddComment(saveId, comment); if(status != RequestOkay) { - new ErrorMessage("Error Submitting comment", Client::Ref().GetLastError()); + new ErrorMessage("Error Submitting comment", Client::Ref().GetLastError()); + return false; } else { previewModel->UpdateComments(1); } } + return true; } void PreviewController::ShowLogin() |
