-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from NikilMunireddy/master
final
- Loading branch information
Showing
104 changed files
with
735 additions
and
152 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
...Code/SmartChain/RestAPI/RestAPI/API/DatabaseConnector/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...SmartChain/RestAPI/RestAPI/API/DatabaseConnector/__pycache__/db_connection.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+22 Bytes
(110%)
...stfulAPI/Code/SmartChain/RestAPI/RestAPI/API/Packages/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...stAPI/RestAPI/API/Packages/auth_api/AuthenticatedPool/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
.../Packages/auth_api/AuthenticatedPool/__pycache__/add_to_authenticated_pool.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...I/Packages/auth_api/AuthenticatedPool/__pycache__/check_authenticated_pool.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...PI/RestAPI/API/Packages/auth_api/CityCounterfeitCount/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...I/Packages/auth_api/CityCounterfeitCount/__pycache__/get_counterfeit_count.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...tAPI/API/Packages/auth_api/CounterfeitCountCityByName/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...es/auth_api/CounterfeitCountCityByName/__pycache__/get_counterfeit_by_name.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...RestAPI/RestAPI/API/Packages/auth_api/CounterfeitList/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...I/API/Packages/auth_api/CounterfeitList/__pycache__/counterfeit_list_count.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...stAPI/API/Packages/auth_api/CounterfeitList/__pycache__/get_all_city_cords.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...estAPI/RestAPI/API/Packages/auth_api/HashRandomNumber/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...API/API/Packages/auth_api/HashRandomNumber/__pycache__/insert_hash_randnum.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.../RestAPI/RestAPI/API/Packages/auth_api/PackageDetails/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.../RestAPI/API/Packages/auth_api/PackageDetails/__pycache__/add_package_hash.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...n/RestAPI/RestAPI/API/Packages/auth_api/PackageUpdate/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...RestAPI/API/Packages/auth_api/PackageUpdate/__pycache__/add_package_update.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...PI/RestAPI/API/Packages/auth_api/PackageUpdate/__pycache__/get_all_details.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...estAPI/RestAPI/API/Packages/auth_api/RandomNumberPool/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...PI/RestAPI/API/Packages/auth_api/RandomNumberPool/__pycache__/check_number.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...I/RestAPI/API/Packages/auth_api/RandomNumberPool/__pycache__/delete_number.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...stAPI/API/Packages/auth_api/RandomNumberPool/__pycache__/get_random_number.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...I/RestAPI/API/Packages/auth_api/RandomNumberPool/__pycache__/insert_number.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...in/RestAPI/RestAPI/API/Packages/auth_api/SpuriousList/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...estAPI/API/Packages/auth_api/SpuriousList/__pycache__/add_to_spurious_list.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...I/RestAPI/API/Packages/auth_api/SpuriousList/__pycache__/get_spurious_list.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...Code/SmartChain/RestAPI/RestAPI/API/Packages/auth_api/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...SmartChain/RestAPI/RestAPI/API/Packages/auth_api/__pycache__/db_connection.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...estAPI/RestAPI/API/Packages/auth_api/passwordvalidate/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...stAPI/API/Packages/auth_api/passwordvalidate/__pycache__/validate_password.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...PI/Packages/auth_api/passwordvalidate/__pycache__/validate_pharma_password.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...SmartChain/RestAPI/RestAPI/API/Packages/blockdb/__pycache__/big_chain_conn.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...de/SmartChain/RestAPI/RestAPI/API/Packages/blockdb/__pycache__/get_from_db.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...de/SmartChain/RestAPI/RestAPI/API/Packages/blockdb/__pycache__/write_to_db.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...e/SmartChain/RestAPI/RestAPI/API/Packages/geoDecoding/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...SmartChain/RestAPI/RestAPI/API/Packages/geoDecoding/__pycache__/geo_decode.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...artChain/RestAPI/RestAPI/API/Packages/randomNumberGen/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
.../RestAPI/RestAPI/API/Packages/randomNumberGen/__pycache__/generate_randnum.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...lAPI/Code/SmartChain/RestAPI/RestAPI/API/PasswordAuth/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...rtChain/RestAPI/RestAPI/API/PasswordAuth/__pycache__/validate_manufacturer.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...de/SmartChain/RestAPI/RestAPI/API/PasswordAuth/__pycache__/validate_pharma.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+22 Bytes
(110%)
...estfulAPI/Code/SmartChain/RestAPI/RestAPI/API/Product/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...I/Code/SmartChain/RestAPI/RestAPI/API/Product/__pycache__/product_is_valid.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...PI/Code/SmartChain/RestAPI/RestAPI/API/ProductDetails/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.../SmartChain/RestAPI/RestAPI/API/ProductDetails/__pycache__/collect_details.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...rtChain/RestAPI/RestAPI/API/ProductDetails/__pycache__/get_product_details.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...API/Code/SmartChain/RestAPI/RestAPI/API/ProductReport/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...SmartChain/RestAPI/RestAPI/API/ProductReport/__pycache__/counterfeit_cords.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.../SmartChain/RestAPI/RestAPI/API/ProductReport/__pycache__/counterfeit_list.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...lAPI/Code/SmartChain/RestAPI/RestAPI/API/ReportOfCity/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ode/SmartChain/RestAPI/RestAPI/API/ReportOfCity/__pycache__/report_of_city.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...Code/SmartChain/RestAPI/RestAPI/API/UpdateProductScan/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ain/RestAPI/RestAPI/API/UpdateProductScan/__pycache__/add_productscan_info.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...SmartChain/RestAPI/RestAPI/API/UpdateProductScan/__pycache__/trace_product.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...I/Code/SmartChain/RestAPI/RestAPI/API/ValidateProduct/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...martChain/RestAPI/RestAPI/API/ValidateProduct/__pycache__/validate_product.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+22 Bytes
(110%)
...tChain/RestfulAPI/Code/SmartChain/RestAPI/RestAPI/API/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...PI/Code/SmartChain/RestAPI/RestAPI/API/__pycache__/default_constant_values.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+22 Bytes
(110%)
...PI/Code/SmartChain/RestAPI/RestAPI/API/testConnection/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.../SmartChain/RestAPI/RestAPI/API/testConnection/__pycache__/test_connection.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+22 Bytes
(110%)
SmartChain/RestfulAPI/Code/SmartChain/RestAPI/RestAPI/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
SmartChain/RestfulAPI/Code/SmartChain/RestAPI/RestAPI/__pycache__/settings.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
SmartChain/RestfulAPI/Code/SmartChain/RestAPI/RestAPI/__pycache__/urls.cpython-36.pyc
Binary file not shown.
Binary file modified
BIN
+22 Bytes
(100%)
SmartChain/RestfulAPI/Code/SmartChain/RestAPI/RestAPI/__pycache__/wsgi.cpython-36.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
asset-manifest.json,1557204106684,483441ee15fb73ea5b98ea2839b2509e8ba5d3ef73cea875897413c46ed5feb1 | ||
favicon.ico,1557204098232,c599b7a91ab3627e3538125d9f40adc2d4bf949046984262670545dc7738af06 | ||
manifest.json,1557204098232,ed7b98046be74c7d1476b73ebb8cd1f00c2b34443af1525af60b9dd20be9fb9a | ||
index.html,1557204106684,5ee14608badc8740191e1185f50db3df1701edc3810c945753956f301f1cd997 | ||
precache-manifest.13912b388e01573d0c424f86784e0594.js,1557204106684,6a50bf881c67276735701291411379db3bdce93ca061501d076ce4067e49b6be | ||
service-worker.js,1557204106684,d6ead3a8a0eb5b1378f7f6ae6fc9fec935cda531657b56b68824d011ea588e3d | ||
static/css/2.e3baaec3.chunk.css,1557204106672,610a7d8fa4bc38f8101c2587539b3ace783627de0ed0ab183736cccdcdcbb961 | ||
static/css/main.aeb52962.chunk.css,1557204106664,b4343c599eba9b727cb1def04528d61ad65bb8a057c16cdf6b05abd54ce82b49 | ||
static/css/main.aeb52962.chunk.css.map,1557204106672,a56637951e98a51667d8461a48ff809eb167234ec56f1d03205048b088e46a8e | ||
static/css/2.e3baaec3.chunk.css.map,1557204106672,d162c7984df7fff247cf9b5b318b72509f126041004d00b30034bbc5d1841152 | ||
static/js/runtime~main.a8a9905a.js,1557204106672,5b0313db8c475761662a933e703f2a6bd16847cdfc34b81915f5dd56862e4e77 | ||
static/js/main.6b81c0bf.chunk.js,1557204106664,ca765d20c0545981f49adc9c75277e39e6f226d0619cdec95f40e77fc3ead40e | ||
static/js/runtime~main.a8a9905a.js.map,1557204106672,2510643041ce395196dfc3f9ae31cd72d7127dbd8457479959c6e22dd1b1eaeb | ||
static/js/main.6b81c0bf.chunk.js.map,1557204106672,c903e5d877344d8e10cad51e6a087d83d76a0f0e6dbaad3014b5a1d5ad89e330 | ||
static/media/user-group.2c1307ce.png,1557204106672,fc7a6d797ee61a6eff726e35822a2bb1a7bc71f9968f5ade03c4682b53b8a657 | ||
static/media/smartchain.4d5d888c.jpg,1557204106664,6b8fcba981d2bafd7158b37362b09f58ceeb66fe64d6420f2f9c1a612b2ce28e | ||
static/media/factory-1.90c2bd33.gif,1557204106672,abeb3e41cde7defae6fff2fb9d1fd8dc8f655b38a428d300b344ba8ebd330cb2 | ||
static/js/2.ec6c5352.chunk.js,1557204106672,7332674162c339a65d2b8fe9db0698646aa724ec7d85a57ebe722b33d1e28162 | ||
static/media/gepezet.dfeb66b3.gif,1557204106672,342610cda37d4d9541f60b3da32ccbe239d1288c9a3f22e27acaa2083f1d0a50 | ||
static/media/pcori_animation_revised-copy.9a461691.gif,1557204106672,25de276f97cf9d71d37264a8f3dfa0c6f2c35faf1ff6deb9eb42acb052d118a1 | ||
static/js/2.ec6c5352.chunk.js.map,1557204106684,11c7dcd8d5e539eb1d7ca7148f01993722db2b82aaf703f761e8ff9d94945af0 | ||
static/media/404.c05691ec.gif,1557204106672,aac364a00bb61d133e41da7eccafd71ca4f47e52d4392d95e2354ca244de79f1 | ||
service-worker.js,1557679212426,f98d4b2a048809b8413d52b90a762e55e4d57b2e8b9816fa1df27423ffdb39bf | ||
asset-manifest.json,1557679220214,a6a8430755137ed63cd7af73cc8ba265929edd4c8fe4dfd192240d7bf98f37e0 | ||
manifest.json,1557679212426,ffd5adbd1c1898680db12100ee5aca152cf71a1c15a744aa99a1b8dd3adc4a8d | ||
index.html,1557679220214,ebdd0ebedfb70fd40eff094f7393777fe2d5a96db780f5ba7d947122eb4ced39 | ||
favicon.ico,1557679212426,c599b7a91ab3627e3538125d9f40adc2d4bf949046984262670545dc7738af06 | ||
precache-manifest.f72d15a5a9b22f24a98c54e0b124ac24.js,1557679220214,6261923f9a5689b5bfbbfca61d19cff37e026bfd72e6005b90e464a80a7fb115 | ||
service-worker.js,1557679220214,1cc3eac317b6d598f8eaa34d6672a9c8bba4a8ffa5b2db3d43ee801c51f5c410 | ||
worker.js,1557679212426,21ae494b708c010b67dba480123b028a9a8e3596a33d1b1fcefe0dc3d74f98ed | ||
static/css/2.e3baaec3.chunk.css,1557679220214,610a7d8fa4bc38f8101c2587539b3ace783627de0ed0ab183736cccdcdcbb961 | ||
static/css/main.4717e4cc.chunk.css,1557679220206,2f485a8cf430dcbde1a47abd7b0258949827823573b91164e8aa491ee677a1de | ||
static/css/main.4717e4cc.chunk.css.map,1557679220214,b91bc397d46ff50105b6d9f5c465b51db7914de17bd9d2fff044813197cbb5a0 | ||
static/js/main.8987dd51.chunk.js,1557679220206,dd9290b87a5d77f0847ba595f6ee4884d78e386bfc23a498399955e26776a40a | ||
static/js/runtime~main.a8a9905a.js,1557679220214,5b0313db8c475761662a933e703f2a6bd16847cdfc34b81915f5dd56862e4e77 | ||
static/js/runtime~main.a8a9905a.js.map,1557679220214,2510643041ce395196dfc3f9ae31cd72d7127dbd8457479959c6e22dd1b1eaeb | ||
static/css/2.e3baaec3.chunk.css.map,1557679220214,d162c7984df7fff247cf9b5b318b72509f126041004d00b30034bbc5d1841152 | ||
static/js/main.8987dd51.chunk.js.map,1557679220214,f00d7d5355e0ee22ee18d4d8c08b154532ebb38d3852451026af576961822b0b | ||
static/media/smartchain.4d5d888c.jpg,1557679220206,6b8fcba981d2bafd7158b37362b09f58ceeb66fe64d6420f2f9c1a612b2ce28e | ||
static/media/user-group.2c1307ce.png,1557679220210,fc7a6d797ee61a6eff726e35822a2bb1a7bc71f9968f5ade03c4682b53b8a657 | ||
smartchain.png,1557679212426,5924fe78146228a51848fcf3f6850cc75effb25b9dc592960d49229e50b9bb7c | ||
static/media/factory-1.90c2bd33.gif,1557679220210,abeb3e41cde7defae6fff2fb9d1fd8dc8f655b38a428d300b344ba8ebd330cb2 | ||
static/js/2.c2f8b8ac.chunk.js,1557679220214,5e35014cfa82cbf42668137c826ce7ecd5d0f0c9834a5ec386875a2ce42ab515 | ||
static/media/gepezet.dfeb66b3.gif,1557679220210,342610cda37d4d9541f60b3da32ccbe239d1288c9a3f22e27acaa2083f1d0a50 | ||
static/media/load.640b7b0d.gif,1557679220214,2cc8f036fbbdc4accd128914295345c2de51497fda1fec104acc32f4dd6e82db | ||
static/media/pcori_animation_revised-copy.9a461691.gif,1557679220210,25de276f97cf9d71d37264a8f3dfa0c6f2c35faf1ff6deb9eb42acb052d118a1 | ||
static/js/2.c2f8b8ac.chunk.js.map,1557679220222,d587ee57ae69af150647c36d5566dbf53deda996c821396a8e97e730bc3f5de9 | ||
static/media/404.c05691ec.gif,1557679220214,aac364a00bb61d133e41da7eccafd71ca4f47e52d4392d95e2354ca244de79f1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var doCache = false; | ||
|
||
var CACHE_NAME = "my-pwa-cache-v1"; | ||
|
||
self.addEventListener("activate", event => { | ||
const cacheWhitelist = [CACHE_NAME]; | ||
event.waitUntil( | ||
caches.keys().then(keyList => | ||
Promise.all( | ||
keyList.map(key => { | ||
if (!cacheWhitelist.includes(key)) { | ||
console.log("Deleting cache: " + key); | ||
return caches.delete(key); | ||
} | ||
}) | ||
) | ||
) | ||
); | ||
}); | ||
|
||
self.addEventListener("install", function(event) { | ||
if (doCache) { | ||
event.waitUntil( | ||
caches.open(CACHE_NAME).then(function(cache) { | ||
fetch("manifest.json") | ||
.then(response => { | ||
response.json(); | ||
}) | ||
.then(assets => { | ||
const urlsToCache = ["/", assets["main.js"]]; | ||
cache.addAll(urlsToCache); | ||
console.log("cached"); | ||
}); | ||
}) | ||
); | ||
} | ||
}); | ||
|
||
self.addEventListener("fetch", function(event) { | ||
if (doCache) { | ||
event.respondWith( | ||
caches.match(event.request).then(function(response) { | ||
return response || fetch(event.request); | ||
}) | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"short_name": "React App", | ||
"name": "Create React App Sample", | ||
"short_name": "Smart chain", | ||
"name": "Smart portal from manufacturer", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
"src": "logo.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": ".", | ||
"start_url": "/", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
"theme_color": "#000", | ||
"background_color": "#000" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
var doCache = false; | ||
|
||
// Name our cache | ||
var CACHE_NAME = 'my-pwa-cache-v1'; | ||
|
||
// Delete old caches that are not our current one! | ||
self.addEventListener("activate", event => { | ||
const cacheWhitelist = [CACHE_NAME]; | ||
event.waitUntil( | ||
caches.keys() | ||
.then(keyList => | ||
Promise.all(keyList.map(key => { | ||
if (!cacheWhitelist.includes(key)) { | ||
console.log('Deleting cache: ' + key) | ||
return caches.delete(key); | ||
} | ||
})) | ||
) | ||
); | ||
}); | ||
|
||
// The first time the user starts up the PWA, 'install' is triggered. | ||
self.addEventListener('install', function(event) { | ||
if (doCache) { | ||
event.waitUntil( | ||
caches.open(CACHE_NAME) | ||
.then(function(cache) { | ||
// Get the assets manifest so we can see what our js file is named | ||
// This is because webpack hashes it | ||
fetch("asset-manifest.json") | ||
.then(response => { | ||
response.json() | ||
}) | ||
.then(assets => { | ||
// Open a cache and cache our files | ||
// We want to cache the page and the main.js generated by webpack | ||
// We could also cache any static assets like CSS or images | ||
const urlsToCache = [ | ||
"/", | ||
assets["main.js"] | ||
] | ||
cache.addAll(urlsToCache) | ||
console.log('cached'); | ||
}) | ||
}) | ||
); | ||
} | ||
}); | ||
|
||
// When the webpage goes to fetch files, we intercept that request and serve up the matching files | ||
// if we have them | ||
self.addEventListener('fetch', function(event) { | ||
if (doCache) { | ||
event.respondWith( | ||
caches.match(event.request).then(function(response) { | ||
return response || fetch(event.request); | ||
}) | ||
); | ||
} | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Flag for enabling cache in production | ||
var doCache = false; | ||
var CACHE_NAME = 'pwa-app-cache'; | ||
// Delete old caches | ||
self.addEventListener('activate', event => { | ||
const currentCachelist = [CACHE_NAME]; | ||
event.waitUntil( | ||
caches.keys() | ||
.then(keyList => | ||
Promise.all(keyList.map(key => { | ||
if (!currentCachelist.includes(key)) { | ||
return caches.delete(key); | ||
} | ||
})) | ||
) | ||
); | ||
}); | ||
// This triggers when user starts the app | ||
self.addEventListener('install', function(event) { | ||
if (doCache) { | ||
event.waitUntil( | ||
caches.open(CACHE_NAME) | ||
.then(function(cache) { | ||
fetch('asset-manifest.json') | ||
.then(response => { | ||
response.json(); | ||
}) | ||
.then(assets => { | ||
// We will cache initial page and the main.js | ||
// We could also cache assets like CSS and images | ||
const urlsToCache = [ | ||
'/', | ||
assets['main.js'] | ||
]; | ||
cache.addAll(urlsToCache); | ||
}) | ||
}) | ||
); | ||
} | ||
}); | ||
// Here we intercept request and serve up the matching files | ||
self.addEventListener('fetch', function(event) { | ||
if (doCache) { | ||
event.respondWith( | ||
caches.match(event.request).then(function(response) { | ||
return response || fetch(event.request); | ||
}) | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.