Unverified Commit 69a9c2b8 authored by Sean Hammond's avatar Sean Hammond Committed by GitHub

Merge pull request #658 from hypothesis/hide-direct-link-cta-for-third-party-accounts

Hide the direct-link CTA for third party accounts
parents b916ee2d ad67c286
......@@ -2,6 +2,7 @@
var SearchClient = require('../search-client');
var events = require('../events');
var isThirdPartyService = require('../util/is-third-party-service');
var memoize = require('../util/memoize');
var tabs = require('../tabs');
var uiConstants = require('../ui-constants');
......@@ -292,6 +293,12 @@ function SidebarContentController(
return false;
}
// The CTA text and links are only applicable when using Hypothesis
// accounts.
if (isThirdPartyService(settings)) {
return false;
}
// The user is logged out and has landed on a direct linked
// annotation. If there is an annotation selection and that
// selection is available to the user, show the CTA.
......
......@@ -506,6 +506,17 @@ describe('sidebar.components.sidebar-content', function () {
$scope.$digest();
assert.isFalse(ctrl.shouldShowLoggedOutMessage());
});
it('does not show loggedout message if using third-party accounts', function () {
fakeSettings.services = [{ authority: 'publisher.com' }];
addFrame();
ctrl.auth = { status: 'logged-out' };
annotationUI.addAnnotations([{id: '123'}]);
annotationUI.selectAnnotations(['123']);
$scope.$digest();
assert.isFalse(ctrl.shouldShowLoggedOutMessage());
});
});
describe('deferred websocket connection', 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