From 4824c2d3447de95ee48446d9460a78cb08772c46 Mon Sep 17 00:00:00 2001 From: Brock H Caldwell Date: Mon, 14 Jul 2025 21:11:57 -0500 Subject: [PATCH] fix: adds pull-to-refresh to pwa --- assets/app.js | 8 ++++++++ importmap.php | 3 +++ 2 files changed, 11 insertions(+) diff --git a/assets/app.js b/assets/app.js index 4ca76d8..4d91be4 100644 --- a/assets/app.js +++ b/assets/app.js @@ -6,6 +6,7 @@ import './bootstrap.js'; * which should already be in your base.html.twig. */ import './styles/app.css'; +import PullToRefresh from 'pulltorefreshjs'; console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉'); @@ -18,3 +19,10 @@ var observer = new MutationObserver(function(mutations) { observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true}); +const ptr = PullToRefresh.init({ + mainElement: 'body', + onRefresh() { + window.location.reload(); + } +}); + diff --git a/importmap.php b/importmap.php index 4aa8096..fa87c7b 100644 --- a/importmap.php +++ b/importmap.php @@ -64,4 +64,7 @@ return [ 'version' => '2.4.3', 'type' => 'css', ], + 'pulltorefreshjs' => [ + 'version' => '0.1.22', + ], ];