Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/templates/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ angular.module('oppia').config([
'SolutionObjectFactory', 'StateCardObjectFactory',
'StateImprovementSuggestionService', 'StateObjectFactory',
'StatesObjectFactory', 'TextInputRulesService', 'UrlInterpolationService',
'UrlService', 'UserInfoObjectFactory', 'UtilsService',
'UrlService', 'UserInfoObjectFactory', 'UserService', 'UtilsService',
'ValidatorsService', 'WindowDimensionsService', 'WindowRef'];
for (let [key, value] of Object.entries(ugs.getUpgradedServices())) {
if (servicesToProvide.includes(key)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ angular.module('oppia').directive('collectionPlayerPage', [
ctrl.collectionPlaythrough.getCompletedExplorationIds());
return completedExplorationIds.indexOf(explorationId) > -1;
};
$rootScope.$apply();
});
},
function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ angular.module('oppia').directive('conversationSkin', [
$scope.inStoryMode = false;
UserService.getUserInfoAsync().then(function(userInfo) {
$scope.isLoggedIn = userInfo.isLoggedIn();
$rootScope.$apply();
});

$scope.collectionId = UrlService.getCollectionIdFromExplorationUrl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ angular.module('oppia').directive('tutorCard', [
UserService.getProfileImageDataUrlAsync()
.then(function(dataUrl) {
$scope.profilePicture = dataUrl;
$rootScope.$apply();
});
} else {
$scope.profilePicture = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ angular.module('oppia').directive('learnerDashboardPage', [
'/pages/learner-dashboard-page/learner-dashboard-page.directive.html'),
controllerAs: '$ctrl',
controller: [
'$scope', '$q', '$window', '$http', '$uibModal', 'AlertsService',
'$rootScope','$scope', '$q', '$window', '$http', '$uibModal', 'AlertsService',
'LoaderService', 'EXPLORATIONS_SORT_BY_KEYS_AND_I18N_IDS',
'ACTIVITY_TYPE_COLLECTION', 'ACTIVITY_TYPE_EXPLORATION',
'SUBSCRIPTION_SORT_BY_KEYS_AND_I18N_IDS', 'FATAL_ERROR_CODES',
Expand All @@ -65,7 +65,7 @@ angular.module('oppia').directive('learnerDashboardPage', [
'FeedbackMessageSummaryObjectFactory',
'SuggestionModalForLearnerDashboardService', 'UserService',
function(
$scope, $q, $window, $http, $uibModal, AlertsService,
$rootScope,$scope, $q, $window, $http, $uibModal, AlertsService,
LoaderService, EXPLORATIONS_SORT_BY_KEYS_AND_I18N_IDS,
ACTIVITY_TYPE_COLLECTION, ACTIVITY_TYPE_EXPLORATION,
SUBSCRIPTION_SORT_BY_KEYS_AND_I18N_IDS, FATAL_ERROR_CODES,
Expand Down Expand Up @@ -489,13 +489,15 @@ angular.module('oppia').directive('learnerDashboardPage', [
ctrl.Math = window.Math;
UserService.getProfileImageDataUrlAsync().then(function(dataUrl) {
ctrl.profilePictureDataUrl = dataUrl;
$rootScope.$apply();
});

LoaderService.showLoadingScreen('Loading');
ctrl.username = '';
var userInfoPromise = UserService.getUserInfoAsync();
userInfoPromise.then(function(userInfo) {
ctrl.username = userInfo.getUsername();
$rootScope.$apply();
});

var dashboardDataPromise = (
Expand Down
5 changes: 3 additions & 2 deletions core/templates/pages/signup-page/signup-page.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ angular.module('oppia').directive('signupPage', [
keyboard: false,
resolve: {},
controller: [
'$scope', '$uibModalInstance', 'SiteAnalyticsService',
'$rootScope','$scope', '$uibModalInstance', 'SiteAnalyticsService',
'UserService', '$window',
function($scope, $uibModalInstance, SiteAnalyticsService,
function($rootScope,$scope, $uibModalInstance, SiteAnalyticsService,
UserService, $window) {
$scope.continueRegistration = function() {
UserService.getLoginUrlAsync().then(
Expand All @@ -206,6 +206,7 @@ angular.module('oppia').directive('signupPage', [
} else {
$window.location.reload();
}
$rootScope.$apply();
}
);
$uibModalInstance.dismiss('cancel');
Expand Down
8 changes: 8 additions & 0 deletions core/templates/services/UpgradedServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ import { WrittenTranslationObjectFactory } from
'domain/exploration/WrittenTranslationObjectFactory';
import { WrittenTranslationsObjectFactory } from
'domain/exploration/WrittenTranslationsObjectFactory';
import {UserService} from 'services/user.service';

@Injectable({
providedIn: 'root'
Expand Down Expand Up @@ -667,6 +668,13 @@ export class UpgradedServices {
upgradedServices['SkillSummaryObjectFactory']);

// Topological level: 4.
upgradedServices['UserService'] = new UserService(
upgradedServices['HttpClient'],
upgradedServices['UrlService'],
upgradedServices['UrlInterpolationService'],
upgradedServices['UserInfoObjectFactory'],
upgradedServices['WindowRef']
);
upgradedServices['PredictionAlgorithmRegistryService'] =
new PredictionAlgorithmRegistryService(
upgradedServices['CodeReplPredictionService'],
Expand Down
1 change: 1 addition & 0 deletions core/templates/services/request-interceptor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class RequestInterceptor implements HttpInterceptor {
intercept(
request: HttpRequest<any>, next: HttpHandler
): Observable<HttpEvent<any>> {
console.log('Intercept triggered');
var csrf = this.csrf;
try {
csrf.initializeToken();
Expand Down
Loading