Plugin Directory

Changeset 2505820


Ignore:
Timestamp:
03/30/2021 09:53:45 AM (5 years ago)
Author:
badprle
Message:

Preventing unnecessary server and API calling

Location:
emitto
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • emitto/readme.txt

    r2505816 r2505820  
    44Plugin URI:   https://emitto.io/
    55Author:       https://producthive.io/
    6 Version:      2.0.8
     6Version:      2.0.9
    77Text Domain:  Emitto
    88License:      GPL v2 or later
  • emitto/trunk/emitto.php

    r2505816 r2505820  
    55Plugin URI:  https://producthive.io
    66Author:      https://producthive.io
    7 Version:     2.0.8
     7Version:     2.0.9
    88This program is free software: you can redistribute it and/or modify
    99    it under the terms of the GNU General Public License as published by
  • emitto/trunk/includes/emitto-functions.php

    r2505816 r2505820  
    99}
    1010//Emitto - Core Functionality
    11 define( 'MY_PLUGIN_VERSION', '2.0.8' );
     11define( 'MY_PLUGIN_VERSION', '2.0.9' );
    1212
    1313
  • emitto/trunk/public/popup.js

    r2505816 r2505820  
    447447        if (Notification.permission === "denied") {
    448448            console.log("Notifications for this website are blocked by browser options")
     449        } else {
     450
     451            const applicationServerKey = urlB64ToUint8Array(applicationServerPublicKey);
     452            console.log('applicationServerKey: ', applicationServerKey);
     453            swRegistration.pushManager.subscribe({
     454                userVisibleOnly: true,
     455                applicationServerKey: applicationServerKey
     456            })
     457                .then(function (subscription) {
     458
     459                    console.log('enter before updateSubscriptionServer subscription: ', subscription);
     460                    let getUrl = window.location;
     461
     462                    updateSubscriptionOnServer(subscription);
     463
     464                    isSubscribed = true;
     465
     466                    updateBtn();
     467                    if (popup !== null) {
     468                        fadeOutEffect(popup)
     469                    }
     470                })
     471                .catch(function (err) {
     472                    console.log('Failed to subscribe the user: ', err);
     473                    updateBtn();
     474                });
    449475        }
    450 
    451         const applicationServerKey = urlB64ToUint8Array(applicationServerPublicKey);
    452         console.log('applicationServerKey: ', applicationServerKey);
    453         swRegistration.pushManager.subscribe({
    454             userVisibleOnly: true,
    455             applicationServerKey: applicationServerKey
    456         })
    457             .then(function (subscription) {
    458 
    459                 console.log('enter before updateSubscriptionServer subscription: ', subscription);
    460                 let getUrl = window.location;
    461 
    462                 updateSubscriptionOnServer(subscription);
    463 
    464                 isSubscribed = true;
    465 
    466                 updateBtn();
    467                 if (popup !== null) {
    468                     fadeOutEffect(popup)
    469                 }
    470             })
    471             .catch(function (err) {
    472                 console.log('Failed to subscribe the user: ', err);
    473                 updateBtn();
    474             });
    475476    }
    476477}
  • emitto/trunk/readme.txt

    r2505816 r2505820  
    44Plugin URI:   https://emitto.io/
    55Author:       https://producthive.io/
    6 Version:      2.0.8
     6Version:      2.0.9
    77Text Domain:  Emitto
    88License:      GPL v2 or later
Note: See TracChangeset for help on using the changeset viewer.