Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 4a0938f

Browse files
committed
add clearPendingRestart and return bool from restartApp indicating if restart has been initiated
1 parent 02633ef commit 4a0938f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

RestartManager.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ const RestartManager = (() => {
88
function restartApp(onlyIfUpdateIsPending = false) {
99
if (_allowed) {
1010
NativeCodePush.restartApp(onlyIfUpdateIsPending);
11+
log('restaes');
1112
} else {
1213
log("restart not allowed");
1314
_restartPending = true;
15+
return true;
1416
}
1517
}
1618

@@ -28,10 +30,15 @@ const RestartManager = (() => {
2830
_allowed = false;
2931
}
3032

33+
function clearPendingRestart() {
34+
_restartPending = false;
35+
}
36+
3137
return {
3238
allow,
3339
disallow,
3440
restartApp,
41+
clearPendingRestart
3542
};
3643
})();
3744

package-mixins.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module.exports = (NativeCodePush) => {
4545
if (installMode == NativeCodePush.codePushInstallModeImmediate) {
4646
RestartManager.restartApp(false);
4747
} else {
48+
RestartManager.clearPendingRestart();
4849
localPackage.isPending = true; // Mark the package as pending since it hasn't been applied yet
4950
}
5051
},

0 commit comments

Comments
 (0)