Fixup postinstall message if app link is clicked

This commit is contained in:
Johannes Zellner
2019-09-27 19:43:03 +02:00
parent 57f1751309
commit 2ce5b28048
3 changed files with 42 additions and 20 deletions

View File

@@ -77,9 +77,26 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.view = view;
};
$scope.showPostInstall = function () {
if (!$scope.app.manifest.postInstallMessage) return;
$('#postInstallModal').modal('show');
$scope.postInstallMessage = {
confirmed: false,
openApp: false,
show: function (openApp) {
$scope.postInstallMessage.confirmed = false;
$scope.postInstallMessage.openApp = !!openApp;
if (!$scope.app.manifest.postInstallMessage) return;
$('#postInstallModal').modal('show');
},
submit: function () {
if (!$scope.postInstallMessage.confirmed) return;
$scope.app.pendingPostInstallConfirmation = false;
delete localStorage['confirmPostInstall_' + $scope.app.id];
$('#postInstallModal').modal('hide');
}
};
$scope.display = {