Make the user confirm the post install message on first time clicking the app icon

This commit is contained in:
Johannes Zellner
2018-06-14 15:46:55 +02:00
parent 461fb0144e
commit 37c8b2b57f
5 changed files with 73 additions and 3 deletions

View File

@@ -161,7 +161,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
// add sso property for the postInstall message to be shown correctly
$scope.appInstall.app.sso = data.sso;
Client.installApp($scope.appInstall.app.id, $scope.appInstall.app.manifest, $scope.appInstall.app.title, data, function (error) {
Client.installApp($scope.appInstall.app.id, $scope.appInstall.app.manifest, $scope.appInstall.app.title, data, function (error, newAppId) {
if (error) {
if (error.statusCode === 402) {
$scope.appInstall.state = 'appLimitReached';
@@ -191,6 +191,9 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.appInstall.busy = false;
// stash new app id for later
$scope.appInstall.app.id = newAppId;
$scope.appInstall.postInstall();
});
},
@@ -200,6 +203,11 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.appInstall.state = 'postInstall';
$('#collapseInstallForm').collapse('hide');
$('#postInstallMessage').collapse('show');
// we track the postinstall confirmation for the current user's browser
// TODO later we might want to have a notification db to track the state across admins and browsers
localStorage['confirmPostInstall_' + $scope.appInstall.app.id] = true;
return;
}