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

Commit 0bd9afb

Browse files
author
Geoffrey Goh
committed
Min -> Minimum
1 parent 67a65de commit 0bd9afb

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

windows/CodePush.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<ItemGroup>
110110
<Compile Include="CodePushReactPackage.cs" />
111111
<Compile Include="CodePushConstants.cs" />
112-
<Compile Include="MinBackgroundListener.cs" />
112+
<Compile Include="MinimumBackgroundListener.cs" />
113113
<Compile Include="InstallMode.cs" />
114114
<Compile Include="CodePushNativeModule.cs" />
115115
<Compile Include="UpdateManager.cs" />

windows/CodePushNativeModule.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace CodePush.ReactNative
1414
internal class CodePushNativeModule : ReactContextNativeModuleBase
1515
{
1616
private CodePushReactPackage _codePush;
17-
private MinBackgroundListener _minBackgroundListener;
17+
private MinimumBackgroundListener _minimumBackgroundListener;
1818
private ReactContext _reactContext;
1919

2020
public CodePushNativeModule(ReactContext reactContext, CodePushReactPackage codePush) : base(reactContext)
@@ -196,7 +196,7 @@ public void installUpdate(JObject updatePackage, InstallMode installMode, int mi
196196
SettingsManager.SavePendingUpdate(pendingHash, /* isLoading */false);
197197
if (installMode == InstallMode.OnNextResume)
198198
{
199-
if (_minBackgroundListener == null)
199+
if (_minimumBackgroundListener == null)
200200
{
201201
// Ensure we do not add the listener twice.
202202
Action loadBundleAction = () =>
@@ -207,12 +207,12 @@ public void installUpdate(JObject updatePackage, InstallMode installMode, int mi
207207
});
208208
};
209209

210-
_minBackgroundListener = new MinBackgroundListener(loadBundleAction, minimumBackgroundDuration);
211-
_reactContext.AddLifecycleEventListener(_minBackgroundListener);
210+
_minimumBackgroundListener = new MinimumBackgroundListener(loadBundleAction, minimumBackgroundDuration);
211+
_reactContext.AddLifecycleEventListener(_minimumBackgroundListener);
212212
}
213213
else
214214
{
215-
_minBackgroundListener.MinimumBackgroundDuration = minimumBackgroundDuration;
215+
_minimumBackgroundListener.MinimumBackgroundDuration = minimumBackgroundDuration;
216216
}
217217
}
218218

windows/CodePushReactPackage.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ public async Task<string> GetJavaScriptBundleFileAsync(string assetsBundleFileNa
128128
return binaryJsBundleUrl;
129129
}
130130
}
131+
131132
#endregion
132133

133134
#region Internal methods
135+
134136
internal async Task<long> GetBinaryResourcesModifiedTime()
135137
{
136138
var assetJSBundleFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(CodePushConstants.AssetsBundlePrefix + AssetsBundleFileName));
@@ -173,9 +175,11 @@ internal async Task ClearUpdates()
173175
SettingsManager.RemovePendingUpdate();
174176
SettingsManager.RemoveFailedUpdates();
175177
}
178+
176179
#endregion
177180

178181
#region Private methods
182+
179183
private async Task ClearReactDevBundleCache()
180184
{
181185
var devBundleCacheFile = (StorageFile) await ApplicationData.Current.LocalFolder.TryGetItemAsync(CodePushConstants.ReactDevBundleCacheFileName);
@@ -192,6 +196,7 @@ private async Task RollbackPackage()
192196
await UpdateManager.RollbackPackage();
193197
SettingsManager.RemovePendingUpdate();
194198
}
199+
195200
#endregion
196201
}
197202
}

windows/MinBackgroundListener.cs renamed to windows/MinimumBackgroundListener.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33

44
namespace CodePush.ReactNative
55
{
6-
internal class MinBackgroundListener : ILifecycleEventListener
6+
internal class MinimumBackgroundListener : ILifecycleEventListener
77
{
88
private DateTime? _lastSuspendDate = null;
99
private Action _resumeAction;
1010

1111
internal int MinimumBackgroundDuration { get; set; }
1212

13-
internal MinBackgroundListener(Action resumeAction, int minBackgroundDuration)
13+
internal MinimumBackgroundListener(Action resumeAction, int minimumBackgroundDuration)
1414
{
1515
_resumeAction = resumeAction;
16-
MinimumBackgroundDuration = minBackgroundDuration;
16+
MinimumBackgroundDuration = minimumBackgroundDuration;
1717
}
1818

1919
public void OnDestroy()

windows/UpdateManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace CodePush.ReactNative
1414
internal class UpdateManager
1515
{
1616
#region Internal methods
17+
1718
internal async Task ClearUpdates()
1819
{
1920
await (await GetCodePushFolder()).DeleteAsync();
@@ -234,9 +235,11 @@ internal async Task RollbackPackage()
234235
info[CodePushConstants.PreviousPackageKey] = null;
235236
await UpdateCurrentPackageInfo(info);
236237
}
238+
237239
#endregion
238240

239241
#region Private methods
242+
240243
private async Task<StorageFolder> GetCodePushFolder()
241244
{
242245
return await ApplicationData.Current.LocalFolder.CreateFolderAsync(CodePushConstants.CodePushFolderPrefix, CreationCollisionOption.OpenIfExists);
@@ -282,6 +285,7 @@ private async Task UpdateCurrentPackageInfo(JObject packageInfo)
282285
{
283286
await FileIO.WriteTextAsync(await GetStatusFile(), JsonConvert.SerializeObject(packageInfo));
284287
}
288+
285289
#endregion
286290
}
287291
}

0 commit comments

Comments
 (0)