Have the "notsquare" error as data, not as message
This commit is contained in:
parent
221bbd275c
commit
d18a070a03
2 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ class Controller {
|
||||||
|
|
||||||
if ($image->valid()) {
|
if ($image->valid()) {
|
||||||
\OC_Cache::set('tmpavatar', $image->data(), 7200);
|
\OC_Cache::set('tmpavatar', $image->data(), 7200);
|
||||||
\OC_JSON::error(array("data" => array("message" => "notsquare") ));
|
\OC_JSON::error(array("data" => "notsquare"));
|
||||||
} else {
|
} else {
|
||||||
$l = new \OC_L10n('core');
|
$l = new \OC_L10n('core');
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ function avatarResponseHandler(data) {
|
||||||
$warning.hide();
|
$warning.hide();
|
||||||
if (data.status === "success") {
|
if (data.status === "success") {
|
||||||
updateAvatar();
|
updateAvatar();
|
||||||
} else if (data.data.message === "notsquare") {
|
} else if (data.data === "notsquare") {
|
||||||
showAvatarCropper();
|
showAvatarCropper();
|
||||||
} else {
|
} else {
|
||||||
$warning.show();
|
$warning.show();
|
||||||
|
|
Loading…
Reference in a new issue