Unverified Commit ac08e935 authored by Benjamin Neff's avatar Benjamin Neff Committed by Steffen van Bergerem

Hide "Follow #tag" button on tag page if not logged in

closes #7155
parent 1f057280
......@@ -33,6 +33,7 @@ Note: Although this is a minor release, the configuration file changed because t
* Fix duplicate flash message on mobile profile edit [#7107](https://github.com/diaspora/diaspora/pull/7107)
* Clicking photos on mobile should no longer cause 404s [#7071](https://github.com/diaspora/diaspora/pull/7071)
* Fix avatar size on mobile privacy page for ignored people [#7148](https://github.com/diaspora/diaspora/pull/7148)
* Don't display tag following button when logged out [#7155](https://github.com/diaspora/diaspora/pull/7155)
## Features
* Deleted comments will be removed when loading more comments [#7045](https://github.com/diaspora/diaspora/pull/7045)
......
......@@ -113,10 +113,12 @@ app.Router = Backbone.Router.extend({
app.tagFollowings.reset(gon.preloads.tagFollowings);
if (name) {
var followedTagsAction = new app.views.TagFollowingAction(
if (app.currentUser.authenticated()) {
var followedTagsAction = new app.views.TagFollowingAction(
{tagText: decodeURIComponent(name).toLowerCase()}
);
$("#author_info").prepend(followedTagsAction.render().el);
);
$("#author_info").prepend(followedTagsAction.render().el);
}
app.tags = new app.views.Tags({hashtagName: name});
}
this._hideInactiveStreamLists();
......
......@@ -26,6 +26,16 @@ describe('app.Router', function () {
expect(followed_tags).toHaveBeenCalled();
expect(tag_following_action).toHaveBeenCalledWith({tagText: 'somethingwithcapitalletters'});
});
it("does not add the TagFollowingAction if not logged in", function() {
var followedTags = spyOn(app.router, "followed_tags").and.callThrough();
var tagFollowingAction = spyOn(app.views, "TagFollowingAction");
logout();
app.router.followed_tags("some_tag");
expect(followedTags).toHaveBeenCalled();
expect(tagFollowingAction).not.toHaveBeenCalled();
});
});
describe("when routing to /stream and hiding inactive stream lists", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment