<commit_before>"use strict";

angular.module("nusPartimeApp").controller("notificationController",
	["$scope", "$location", "Session", "AuthService", "NotificationService",
	function($scope, $location, Session, AuthService, NotificationService) {

		$scope.notificationArray = [];

		AuthService.autoLogin()
		.then(function(){
			NotificationService.getAllNotifications(Session.userId).then(function(res){
				$scope.notificationArray = res;
			});
		});

		$scope.readNotification = function(index) {
			console.log($scope.notificationArray[index].id);
			NotificationService.readNotification($scope.notificationArray[index].id).then(function(res) {
				if (!res.error) {
					$scope.notificationArray[index].status = res.status;
				} else {
					console.log(res.error);
				}
			});
		}
	}]);<commit_msg>Updated notification page to auto reload after click on mark as read<commit_after>"use strict";

angular.module("nusPartimeApp").controller("notificationController",
	["$scope", "$location", "Session", "AuthService", "NotificationService",
	function($scope, $location, Session, AuthService, NotificationService) {

		$scope.notificationArray = [];

		AuthService.autoLogin()
		.then(function(){
			NotificationService.getAllNotifications(Session.userId).then(function(res){
				$scope.notificationArray = res;
			});
		});

		$scope.readNotification = function(index) {
			console.log($scope.notificationArray[index].id);
			NotificationService.readNotification($scope.notificationArray[index].id).then(function(res) {
				if (!res.error) {
					$scope.notificationArray[index].status = res.status;
					location.reload();
				} else {
					console.log(res.error);
				}
			});
		}
	}]);
{'fraction_non_alphanumeric': 0.1592920353982301, 'fraction_numerical': 0.0, 'mean_word_length': 5.167272727272727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6077624', 'n_tokens_mistral': 565, 'n_tokens_neox': 481, 'n_words': 70}