title: value of string is not changing even after i changed it in my code
body: <p>I have created a simple react application in which the user can upload post like in instagram. If a user posted a new post, all the users will be notified with a message like 'new post added'. If i changed the value from 'new post' to 'new notification' it still shows 'new post' I don't know why. can someone help to clear it.</p>
  <blockquote>
  <p>index.js</p>
  </blockquote>
  <pre><code> webpush.sendNotification(pushConfig, JSON.stringify({
          title: 'New Post ',
          content: 'New Post added!',
          openUrl: '/help'
        }))
          .catch(function (err) {
            console.log(err);
          })
      });
  </code></pre>
  <blockquote>
  <p>sw.js</p>
  </blockquote>
  <pre><code>importScripts(&quot;/src/js/idb.js&quot;);
  importScripts(&quot;/src/js/utility.js&quot;);
  
  var CACHE_STATIC_NAME = &quot;static-v30&quot;;
  var CACHE_DYNAMIC_NAME = &quot;dynamic-v2&quot;;
  var STATIC_FILES = [
    &quot;/&quot;,
    &quot;/index.html&quot;,
    &quot;/offline.html&quot;,
    &quot;/src/js/app.js&quot;,
    &quot;/src/js/feed.js&quot;,
    &quot;/src/js/idb.js&quot;,
    &quot;/src/js/promise.js&quot;,
    &quot;/src/js/fetch.js&quot;,
    &quot;/src/js/material.min.js&quot;,
    &quot;/src/css/app.css&quot;,
    &quot;/src/css/feed.css&quot;,
    &quot;/src/images/main-image.jpg&quot;,
    &quot;https://fonts.googleapis.com/css?family=Roboto:400,700&quot;,
    &quot;https://fonts.googleapis.com/icon?family=Material+Icons&quot;,
    &quot;https://cdnjs.cloudflare.com/ajax/libs/material-design-lite/1.3.0/material.indigo-pink.min.css&quot;
  ];
  
  self.addEventListener(&quot;install&quot;, function(event) {
    console.log(&quot;[Service Worker] Installing Service Worker ...&quot;, event);
    event.waitUntil(
      caches.open(CACHE_STATIC_NAME).then(function(cache) {
        console.log(&quot;[Service Worker] Precaching App Shell&quot;);
        cache.addAll(STATIC_FILES);
      })
    );
  });
  
  self.addEventListener(&quot;activate&quot;, function(event) {
    console.log(&quot;[Service Worker] Activating Service Worker ....&quot;, event);
    event.waitUntil(
      caches.keys().then(function(keyList) {
        return Promise.all(
          keyList.map(function(key) {
            if (key !== CACHE_STATIC_NAME &amp;&amp; key !== CACHE_DYNAMIC_NAME) {
              console.log(&quot;[Service Worker] Removing old cache.&quot;, key);
              return caches.delete(key);
            }
          })
        );
      })
    );
    return self.clients.claim();
  });
  
  function isInArray(string, array) {
    var cachePath;
    if (string.indexOf(self.origin) === 0) {
      // request targets domain where we serve the page from (i.e. NOT a CDN)
      console.log(&quot;matched &quot;, string);
      cachePath = string.substring(self.origin.length); // take the part of the URL AFTER the domain (e.g. after localhost:8080)
    } else {
      cachePath = string; // store the full request (for CDNs)
    }
    return array.indexOf(cachePath) &gt; -1;
  }
  
  self.addEventListener(&quot;fetch&quot;, function(event) {
    var url = &quot;https://pwagram-68415.firebaseio.com/posts&quot;;
    if (event.request.url.indexOf(url) &gt; -1) {
      event.respondWith(
        fetch(event.request).then(function(res) {
          var clonedRes = res.clone();
          clearAllData(&quot;posts&quot;)
            .then(function() {
              return clonedRes.json();
            })
            .then(function(data) {
              for (var key in data) {
                writeData(&quot;posts&quot;, data[key]);
              }
            });
          return res;
        })
      );
    } else if (isInArray(event.request.url, STATIC_FILES)) {
      event.respondWith(caches.match(event.request));
    } else {
      event.respondWith(
        caches.match(event.request).then(function(response) {
          if (response) {
            return response;
          } else {
            return fetch(event.request)
              .then(function(res) {
                return caches.open(CACHE_DYNAMIC_NAME).then(function(cache) {
                  // trimCache(CACHE_DYNAMIC_NAME, 3);
                  cache.put(event.request.url, res.clone());
                  return res;
                });
              })
              .catch(function(err) {
                return caches.open(CACHE_STATIC_NAME).then(function(cache) {
                  if (event.request.headers.get(&quot;accept&quot;).includes(&quot;text/html&quot;)) {
                    return cache.match(&quot;/offline.html&quot;);
                  }
                });
              });
          }
        })
      );
    }
  });
  
  self.addEventListener(&quot;sync&quot;, function(event) {
    console.log(&quot;[Service Worker] Background syncing&quot;, event);
    if (event.tag === &quot;sync-new-posts&quot;) {
      console.log(&quot;[Service Worker] Syncing new Posts&quot;);
      event.waitUntil(
        readAllData(&quot;sync-posts&quot;).then(function(data) {
          for (var dt of data) {
            fetch(
              &quot;https://us-central1-pwagram-68415.cloudfunctions.net/storePostData&quot;,
              {
                method: &quot;POST&quot;,
                headers: {
                  &quot;Content-Type&quot;: &quot;application/json&quot;,
                  Accept: &quot;application/json&quot;
                },
                body: JSON.stringify({
                  id: dt.id,
                  title: dt.title,
                  location: dt.location,
                  image:
                    &quot;https://firebasestorage.googleapis.com/v0/b/pwagram-68415.appspot.com/o/sf-boat.jpg?alt=media&amp;token=bb1cea7e-45bd-40e5-8bf6-109892f54601&quot;
                })
              }
            )
              .then(function(res) {
                console.log(&quot;Sent data&quot;, res);
                if (res.ok) {
                  res.json().then(function(resData) {
                    deleteItemFromData(&quot;sync-posts&quot;, resData.id);
                  });
                }
              })
              .catch(function(err) {
                console.log(&quot;Error while sending data&quot;, err);
              });
          }
        })
      );
    }
  });
  self.addEventListener(&quot;notificationclick&quot;, function(event) {
    var notification = event.notification;
    var action = event.action;
  
    console.log(notification);
  
    if (action === &quot;confirm&quot;) {
      console.log(&quot;Confirm was chosen&quot;);
      notification.close();
    } else {
      console.log(action);
      event.waitUntil(
        clients.matchAll().then(function(clis) {
          var client = clis.find(function(c) {
            return c.visibilityState === &quot;visible&quot;;
          });
  
          if (client !== undefined) {
            client.navigate(notification.data.url);
            client.focus();
          } else {
            clients.openWindow(notification.data.url);
          }
          notification.close();
        })
      );
    }
  });
  self.addEventListener(&quot;notificationclose&quot;, function(event) {
    console.log(&quot;Notification was closed&quot;, event);
  });
  
  self.addEventListener(&quot;push&quot;, function(event) {
    console.log(&quot;Push Notification received&quot;, event);
  
    var data = {
      title: &quot;New!&quot;,
      content: &quot;Something new happened!&quot;,
      openUrl: &quot;/&quot;
    };
  
    if (event.data) {
      data = JSON.parse(event.data.text());
    }
  
    var options = {
      body: data.content,
      icon: &quot;/src/images/icons/app-icon-96x96.png&quot;,
      badge: &quot;/src/images/icons/app-icon-96x96.png&quot;,
      data: {
        url: data.openUrl
      }
    };
  
    event.waitUntil(self.registration.showNotification(data.title, options));
  });
  </code></pre>