From 14d69243387ab607a4a35f716517f5f3d41d25e8 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 20 May 2023 02:33:26 +0200 Subject: [PATCH] Added beforeinstallprompt listener --- platypush/backend/http/webapp/src/App.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platypush/backend/http/webapp/src/App.vue b/platypush/backend/http/webapp/src/App.vue index bc48a6ea0..f10cd04b8 100644 --- a/platypush/backend/http/webapp/src/App.vue +++ b/platypush/backend/http/webapp/src/App.vue @@ -68,6 +68,14 @@ export default { this.initConfig() }, + beforeMount() { + window.addEventListener('beforeinstallprompt', (e) => { + e.preventDefault() + if (confirm('Would you like to install the application for more features?')) + e.prompt() + }) + }, + mounted() { bus.onNotification(this.onNotification) },