Skip to content

Commit 377e077

Browse files
committed
Refactor UpdateButton and UpdateOnStart components to use @srcpush/react-native-code-push and improve code formatting
1 parent 25e0cf7 commit 377e077

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Recipes/UpdateButton.ios.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ var {
1010
} = React;
1111
var Button = require('react-native-button');
1212

13-
var CodePush = require('react-native-code-push');
13+
var CodePush = require('@srcpush/react-native-code-push');
1414

1515
var UpdateButton = React.createClass({
16-
getInitialState: function() {
16+
getInitialState: function () {
1717
return {};
1818
},
19-
componentDidMount: function() {
19+
componentDidMount: function () {
2020
CodePush.checkForUpdate().done((update) => {
2121
if (update && !update.downloadURL) {
2222
this.setState({
23-
update: update
23+
update: update
2424
});
2525
}
2626
});
2727
},
28-
update: function() {
28+
update: function () {
2929
this.state.update.download().done((newPackage) => {
3030
newPackage.install();
3131
});
3232
},
33-
render: function() {
33+
render: function () {
3434
var updateButton = null;
3535
if (this.state.update) {
3636
updateButton = <Button onPress={this.update}>Update</Button>;

Recipes/UpdateOnStart.ios.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ var {
99
View,
1010
} = React;
1111

12-
var CodePush = require('react-native-code-push');
12+
var CodePush = require('@srcpush/react-native-code-push');
1313

1414
var UpdateOnStart = React.createClass({
15-
componentDidMount: function() {
15+
componentDidMount: function () {
1616
CodePush.checkForUpdate().done((update) => {
1717
if (update && update.downloadUrl) {
1818
update.download().done((newPackage) => {
@@ -21,7 +21,7 @@ var UpdateOnStart = React.createClass({
2121
}
2222
});
2323
},
24-
render: function() {
24+
render: function () {
2525
return (
2626
<View style={styles.container}>
2727
<Text>

0 commit comments

Comments
 (0)