Closed (fixed)
Project:
PWA - Progressive Web App
Version:
2.0.0-rc2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2023 at 14:12 UTC
Updated:
8 Aug 2023 at 10:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ady1503 commentedI have made the following changes:
in pwa_a2hs.libraries.yml
dependencies:
- core/drupalSettings
- core/jquery
- core/once
and
in js/pwa_a2hs_prompt.js
(function ($, Drupal, once) {
'use strict'
// Use jQuery once() so the button doesn't get added multiple times.
$(once('showButton', '.pwa-a2hs', context)).each(function () {
})(jQuery, Drupal, once);
And the "Install APP" button works.
Commit if is correct.
Thanks
Comment #3
keshavv commentedComment #5
keshavv commentedjQuery.once is deprecated so we need this MR to be merged. Otherwise, JS will throw an error. Created the MR please review it.
Comment #6
ady1503 commentedFor mi, mi changes working well.
Don't forget, the manifest.json file is not loaded automatically.
Comment #7
anybodyFixes LGTM, @Grevil could you please have a final look at this?
Comment #9
fromme commented"Once" feature required
core/drupallibrary (https://www.drupal.org/node/3158256), so i changecore/drupalSettingstocore/drupal(it already use drupalSettings as dependancy).Also attached the patch for using it before changes will be released.
Comment #10
anybodyNice one @fromme! LGTM!
Comment #12
anybodyMerged into 2.x dev!