mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 08:59:35 -05:00
98f031e9aa
Read Licence Attribute from Affiliation Instead of Institution GitOrigin-RevId: 2294222e2bd0da473a303d3ffdc5ddb7d856f7f7
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
define(['base'], App =>
|
|
App.controller('LeftHandMenuPromoController', function(
|
|
$scope,
|
|
UserAffiliationsDataService,
|
|
eventTracking
|
|
) {
|
|
$scope.hasProjects = window.data.projects.length > 0
|
|
$scope.userHasNoSubscription = window.userHasNoSubscription
|
|
|
|
$scope.upgradeSubscription = function() {
|
|
eventTracking.send('subscription-funnel', 'project-page', 'upgrade')
|
|
}
|
|
|
|
$scope.share = function() {
|
|
eventTracking.send('subscription-funnel', 'project-page', 'sharing')
|
|
}
|
|
|
|
const _userHasNoAffiliation = function() {
|
|
$scope.userEmails = []
|
|
$scope.userAffiliations = []
|
|
return UserAffiliationsDataService.getUserEmails().then(function(emails) {
|
|
$scope.userEmails = emails
|
|
$scope.userAffiliations = emails
|
|
.filter(email => email.affiliation)
|
|
.map(email => email.affiliation)
|
|
$scope.userOnPayingUniversity = $scope.userAffiliations.some(
|
|
affiliation => affiliation.licence && affiliation.licence !== 'free'
|
|
)
|
|
})
|
|
}
|
|
|
|
_userHasNoAffiliation()
|
|
}))
|