From 139f6611d6162158ea88c679aee710f7a6c76c49 Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Thu, 16 Jul 2015 08:55:37 -0700
Subject: Added last updated for pictures

---
 web/react/components/user_settings.jsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'web/react/components/user_settings.jsx')

diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index 06d8d0208..b1ccd125a 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -820,6 +820,7 @@ var GeneralTab = React.createClass({
         client.uploadProfileImage(formData,
             function(data) {
                 this.submitActive = false;
+                AsyncClient.getMe();
                 window.location.reload();
             }.bind(this),
             function(err) {
@@ -989,7 +990,7 @@ var GeneralTab = React.createClass({
                 <SettingPicture
                     title="Profile Picture"
                     submit={this.submitPicture}
-                    src={"/api/v1/users/" + user.id + "/image"}
+                    src={"/api/v1/users/" + user.id + "/image?time=" + user.last_picture_update}
                     server_error={server_error}
                     client_error={client_error}
                     updateSection={function(e){self.updateSection("");e.preventDefault();}}
@@ -1000,10 +1001,14 @@ var GeneralTab = React.createClass({
             );
 
         } else {
+            var minMessage = "Click Edit to upload an image.";
+            if (user.last_picture_update) {
+                minMessage = "Image last updated " + utils.displayDate(user.last_picture_update)
+            }
             pictureSection = (
                 <SettingItemMin
                     title="Profile Picture"
-                    describe="Picture inside."
+                    describe={minMessage}
                     updateSection={function(){self.updateSection("picture");}}
                 />
             );
-- 
cgit v1.2.3-1-g7c22

