Skip to content

Commit 7c59bb7

Browse files
committed
Changed loop that goes over settings so it doesn't delete default service_worker_url if one isn't passed
1 parent eef1130 commit 7c59bb7

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

dist/upup.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/upup.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/upup.sw.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/upup.sw.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/upup.zip

14 Bytes
Binary file not shown.

docs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ same settings object directly to the start() method.
4545
UpUp.start({ content: 'Cannot reach site. Please check your internet connection.' });
4646

4747
The settings object supports the following options:
48-
- `content-url` (String) The content to display when user is offline (url to the content that will be served)
49-
- `content` (String) The content to display when user is offline (plain text, HTML, etc.)
50-
- `assets` (Array) Array of assets to cache for offline access
51-
- `service-worker-url` (String) The `upup.sw.js`'s url, allows placing `upup.js` and `upup.sw.js` in different directories and using CDNs.
48+
- `content-url` (String) The content to display when user is offline (url to the content that will be served)
49+
- `content` (String) The content to display when user is offline (plain text, HTML, etc.)
50+
- `assets` (Array) Array of assets to cache for offline access
5251

5352
# API Reference
5453

@@ -102,3 +101,4 @@ debug state on or off.
102101
* **Boolean** *[newState=true]* - Turn on/off debug messages
103102

104103
<!-- End src/upup.js -->
104+

src/upup.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@
150150

151151
// add new settings to our settings object
152152
['content', 'content-url', 'assets', 'service-worker-url'].forEach(function(settingName) {
153-
_settings[settingName] = settings[settingName] || null;
153+
if (settings[settingName] !== undefined) {
154+
_settings[settingName] = settings[settingName];
155+
}
154156
});
155157
},
156158

0 commit comments

Comments
 (0)