Skip to content

Commit 944e05a

Browse files
author
Takeharu Oshida
committed
#39: Fix typo and remove support
1 parent 70aeced commit 944e05a

File tree

5 files changed

+37
-77
lines changed

5 files changed

+37
-77
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
## Change Log
22

3-
### Ver 0.3.0 (Next Release)
3+
### Ver 0.3.2
4+
5+
* [Typo issue](https://github.com/georgeOsdDev/react-web-notification/issues/39)
6+
7+
### Ver 0.3.1
8+
9+
* [Change demo link to https](https://github.com/georgeOsdDev/react-web-notification/issues/33)
10+
11+
### Ver 0.3.0
412

513
* [Update React and dependencies](https://github.com/georgeOsdDev/react-web-notification/issues/31)
614

lib/components/Notification.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,8 @@ var Notification = function (_React$Component) {
9292
key: 'componentDidMount',
9393
value: function componentDidMount() {
9494
if (this.props.disableActiveWindow) {
95-
if (window.addEventListener) {
96-
window.addEventListener('focus', this.onWindowFocus);
97-
window.addEventListener('blur', this.onWindowBlur);
98-
} else if (window.attachEvent) {
99-
window.attachEvent('focus', this.onWindowFocus);
100-
window.attachEvent('blur', this.onWindowBlur);
101-
}
95+
window.addEventListener('focus', this.onWindowFocus);
96+
window.addEventListener('blur', this.onWindowBlur);
10297
}
10398

10499
if (!this.state.supported) {
@@ -121,13 +116,8 @@ var Notification = function (_React$Component) {
121116
key: 'componentWillUnmount',
122117
value: function componentWillUnmount() {
123118
if (this.props.disableActiveWindow) {
124-
if (window.removeEventListner) {
125-
window.removeEventListener('focus', this.onWindowFocus);
126-
window.removeEventListener('blur', this.onWindowBlur);
127-
} else if (window.detachEvent) {
128-
window.detachEvent('focus', this.onWindowFocus);
129-
window.detachEvent('blur', this.onWindowBlur);
130-
}
119+
window.removeEventListener('focus', this.onWindowFocus);
120+
window.removeEventListener('blur', this.onWindowBlur);
131121
}
132122
}
133123
}, {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-web-notification",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "React component with HTML5 Web Notification API",
55
"main": "./lib/components/Notification.js",
66
"scripts": {

src/components/Notification.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,8 @@ class Notification extends React.Component {
6161

6262
componentDidMount(){
6363
if (this.props.disableActiveWindow) {
64-
if (window.addEventListener){
65-
window.addEventListener('focus', this.onWindowFocus);
66-
window.addEventListener('blur', this.onWindowBlur);
67-
} else if (window.attachEvent){
68-
window.attachEvent('focus', this.onWindowFocus);
69-
window.attachEvent('blur', this.onWindowBlur);
70-
}
64+
window.addEventListener('focus', this.onWindowFocus);
65+
window.addEventListener('blur', this.onWindowBlur);
7166
}
7267

7368
if (!this.state.supported) {
@@ -89,13 +84,8 @@ class Notification extends React.Component {
8984

9085
componentWillUnmount(){
9186
if (this.props.disableActiveWindow) {
92-
if (window.removeEventListner){
93-
window.removeEventListener('focus', this.onWindowFocus);
94-
window.removeEventListener('blur', this.onWindowBlur);
95-
} else if (window.detachEvent){
96-
window.detachEvent('focus', this.onWindowFocus);
97-
window.detachEvent('blur', this.onWindowBlur);
98-
}
87+
window.removeEventListener('focus', this.onWindowFocus);
88+
window.removeEventListener('blur', this.onWindowBlur);
9989
}
10090
}
10191

yarn.lock

Lines changed: 19 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,14 +1656,10 @@ di@^0.0.1:
16561656
version "0.0.1"
16571657
resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c"
16581658

1659-
diff@3.3.1:
1659+
diff@3.3.1, diff@^3.1.0:
16601660
version "3.3.1"
16611661
resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75"
16621662

1663-
diff@^3.1.0:
1664-
version "3.4.0"
1665-
resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c"
1666-
16671663
diffie-hellman@^5.0.0:
16681664
version "5.0.2"
16691665
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e"
@@ -2427,20 +2423,13 @@ http-errors@~1.5.0:
24272423
setprototypeof "1.0.2"
24282424
statuses ">= 1.3.1 < 2"
24292425

2430-
http-proxy@1.15.2:
2426+
http-proxy@1.15.2, http-proxy@^1.13.0:
24312427
version "1.15.2"
24322428
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.15.2.tgz#642fdcaffe52d3448d2bda3b0079e9409064da31"
24332429
dependencies:
24342430
eventemitter3 "1.x.x"
24352431
requires-port "1.x.x"
24362432

2437-
http-proxy@^1.13.0:
2438-
version "1.16.2"
2439-
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.16.2.tgz#06dff292952bf64dbe8471fa9df73066d4f37742"
2440-
dependencies:
2441-
eventemitter3 "1.x.x"
2442-
requires-port "1.x.x"
2443-
24442433
http-signature@~1.1.0:
24452434
version "1.1.1"
24462435
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
@@ -2465,14 +2454,10 @@ ignore@^3.3.3:
24652454
version "3.3.7"
24662455
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021"
24672456

2468-
immutable@3.8.1:
2457+
immutable@3.8.1, immutable@^3.7.6:
24692458
version "3.8.1"
24702459
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.1.tgz#200807f11ab0f72710ea485542de088075f68cd2"
24712460

2472-
immutable@^3.7.6:
2473-
version "3.8.2"
2474-
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
2475-
24762461
imurmurhash@^0.1.4:
24772462
version "0.1.4"
24782463
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
@@ -3071,11 +3056,7 @@ mime@1.3.4:
30713056
version "1.3.4"
30723057
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53"
30733058

3074-
"mime@>= 0.0.1":
3075-
version "2.0.3"
3076-
resolved "https://registry.yarnpkg.com/mime/-/mime-2.0.3.tgz#4353337854747c48ea498330dc034f9f4bbbcc0b"
3077-
3078-
mime@^1.3.4:
3059+
"mime@>= 0.0.1", mime@^1.3.4:
30793060
version "1.6.0"
30803061
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
30813062

@@ -3097,18 +3078,14 @@ minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4:
30973078
dependencies:
30983079
brace-expansion "^1.1.7"
30993080

3100-
minimist@0.0.8:
3081+
minimist@0.0.8, minimist@~0.0.1:
31013082
version "0.0.8"
31023083
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
31033084

31043085
minimist@1.2.0, minimist@^1.1.0, minimist@^1.2.0:
31053086
version "1.2.0"
31063087
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
31073088

3108-
minimist@~0.0.1:
3109-
version "0.0.10"
3110-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
3111-
31123089
mkdirp@0.3.0:
31133090
version "0.3.0"
31143091
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
@@ -3676,6 +3653,15 @@ rc@^1.1.7:
36763653
object-assign "^4.1.1"
36773654
prop-types "^15.6.0"
36783655

3656+
"react@^0.14.3 || ^15.0.1 || ^16.2.0":
3657+
version "16.3.2"
3658+
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
3659+
dependencies:
3660+
fbjs "^0.8.16"
3661+
loose-envify "^1.1.0"
3662+
object-assign "^4.1.1"
3663+
prop-types "^15.6.0"
3664+
36793665
read-only-stream@^2.0.0:
36803666
version "2.0.0"
36813667
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
@@ -4169,11 +4155,7 @@ sshpk@^1.7.0:
41694155
jsbn "~0.1.0"
41704156
tweetnacl "~0.14.0"
41714157

4172-
"statuses@>= 1.3.1 < 2":
4173-
version "1.4.0"
4174-
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
4175-
4176-
statuses@~1.3.0, statuses@~1.3.1:
4158+
"statuses@>= 1.3.1 < 2", statuses@~1.3.0, statuses@~1.3.1:
41774159
version "1.3.1"
41784160
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
41794161

@@ -4272,7 +4254,7 @@ subarg@^1.0.0:
42724254
dependencies:
42734255
minimist "^1.1.0"
42744256

4275-
supports-color@4.4.0:
4257+
supports-color@4.4.0, supports-color@^4.0.0, supports-color@^4.4.0:
42764258
version "4.4.0"
42774259
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e"
42784260
dependencies:
@@ -4282,12 +4264,6 @@ supports-color@^2.0.0:
42824264
version "2.0.0"
42834265
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
42844266

4285-
supports-color@^4.0.0, supports-color@^4.4.0:
4286-
version "4.5.0"
4287-
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b"
4288-
dependencies:
4289-
has-flag "^2.0.0"
4290-
42914267
syntax-error@^1.1.1:
42924268
version "1.3.0"
42934269
resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1"
@@ -4358,13 +4334,13 @@ timers-browserify@^1.0.1:
43584334
dependencies:
43594335
process "~0.11.0"
43604336

4361-
tmp@0.0.31:
4337+
tmp@0.0.31, tmp@0.0.x:
43624338
version "0.0.31"
43634339
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7"
43644340
dependencies:
43654341
os-tmpdir "~1.0.1"
43664342

4367-
tmp@0.0.x, tmp@^0.0.33:
4343+
tmp@^0.0.33:
43684344
version "0.0.33"
43694345
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
43704346
dependencies:
@@ -4435,14 +4411,10 @@ typedarray@^0.0.6, typedarray@~0.0.5:
44354411
version "0.0.6"
44364412
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
44374413

4438-
ua-parser-js@0.7.12:
4414+
ua-parser-js@0.7.12, ua-parser-js@^0.7.9:
44394415
version "0.7.12"
44404416
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb"
44414417

4442-
ua-parser-js@^0.7.9:
4443-
version "0.7.17"
4444-
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
4445-
44464418
uid-number@^0.0.6:
44474419
version "0.0.6"
44484420
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"

0 commit comments

Comments
 (0)