summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-01-26 10:45:49 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-02-02 11:17:54 +0100
commitdf75a6e5f37d4dbd1fe6abc0cdfb27037ffd1c99 (patch)
treea842a8d60e0131964eaef03d418eacd2b29ff441 /apps/files
parent359abca50c09f17ab0c1f872990a66ca48eab74d (diff)
downloadnextcloud-server-df75a6e5f37d4dbd1fe6abc0cdfb27037ffd1c99.tar.gz
nextcloud-server-df75a6e5f37d4dbd1fe6abc0cdfb27037ffd1c99.zip
Only update favorite icon if the operation was successful
Also shows a notification in case an error occured on updating the tags
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/tagsplugin.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/files/js/tagsplugin.js b/apps/files/js/tagsplugin.js
index 27ab3eced04..b00aacfba57 100644
--- a/apps/files/js/tagsplugin.js
+++ b/apps/files/js/tagsplugin.js
@@ -105,12 +105,12 @@
} else {
tags.push(OC.TAG_FAVORITE);
}
- toggleStar($actionEl, !isFavorite);
self.applyFileTags(
dir + '/' + fileName,
tags
).then(function(result) {
+ toggleStar($actionEl, !isFavorite);
// response from server should contain updated tags
var newTags = result.tags;
if (_.isUndefined(newTags)) {
@@ -171,6 +171,8 @@
}),
dataType: 'json',
type: 'POST'
+ }).fail(function() {
+ OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags'));
});
}
};