Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Fixed image saving for settings #539

Merged
merged 1 commit into from
Nov 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/settings/account-info/account-info.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
}
});
});
}, 400);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this $timeout affect the image save?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just put it in because without it, there was a console error. i figured whoever wrote the timeout wanted there to be an actual timeout

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I wrote it awhile back? I just left it blank so it'd default to 0, cause I needed it to get added to the end of the event queue. Not having an explicit time shouldn't produce an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's the error:
TypeError: Cannot read property 'currentPassword' of undefined
at Object.fn (http://local.topcoder-dev.com:3000/settings/account-info/account-info.controller.js:46:33)
at Scope.$digest (http://local.topcoder-dev.com:3000/bower_components/angular/angular.js:15715:29)
at Scope.$apply (http://local.topcoder-dev.com:3000/bower_components/angular/angular.js:15986:24)
at http://local.topcoder-dev.com:3000/bower_components/angular/angular.js:17753:36
at completeOutstandingRequest (http://local.topcoder-dev.com:3000/bower_components/angular/angular.js:5490:10)
at http://local.topcoder-dev.com:3000/bower_components/angular/angular.js:5762:7
at nrWrapper (http://local.topcoder-dev.com:3000/settings/account/:322:12787) undefined(anonymous function) @ angular.js:12416(anonymous function) @ angular.js:9203(anonymous function) @ exception-handler.provider.js:57Scope.$digest @ angular.js:15733Scope.$apply @ angular.js:15986(anonymous function) @ angular.js:17753completeOutstandingRequest @ angular.js:5490(anonymous function) @ angular.js:5762nrWrapper @ (index):322
angular.js:12416 Error: Cannot read property 'currentPassword' of undefined Object {exception: TypeError: Cannot read property 'currentPassword' of undefined
at Object.fn (http://local.topcod…, cause: undefined}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird! Wonder why it stopped working haha. I guess 400ms isn't going to hurt anything :D I wish I could get rid of the $timeout completely!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's one of the things we should can when we refactor

}

function updateCountry(angucompleteCountryObj) {
Expand Down
1 change: 1 addition & 0 deletions app/settings/edit-profile/edit-profile.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
.then(ImageService.createFileRecord)
.then(function(newPhotoURL) {
vm.userData.photoURL = newPhotoURL;
userData.photoURL = newPhotoURL;
$rootScope.$broadcast(CONSTANTS.EVENT_PROFILE_UPDATED);
});
}
Expand Down