@capawesome/capacitor-live-update 6.4.0 → 6.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -353,8 +353,15 @@ public class LiveUpdate {
353
353
  }
354
354
 
355
355
  private void deleteBundle(@NonNull String bundleId) {
356
+ // Delete the bundle directory
356
357
  File bundleDirectory = buildBundleDirectoryFor(bundleId);
357
358
  deleteFileRecursively(bundleDirectory);
359
+ // Reset the next bundle if it is the deleted bundle
360
+ String currentBundleId = getCurrentBundleId();
361
+ String nextBundleId = getNextBundleId();
362
+ if (bundleId.equals(currentBundleId) && bundleId.equals(nextBundleId)) {
363
+ setNextCapacitorServerPathToDefaultWebAssetDir();
364
+ }
358
365
  }
359
366
 
360
367
  private void deleteFileRecursively(@NonNull File file) {
@@ -19,7 +19,7 @@ import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
19
19
  public class LiveUpdatePlugin extends Plugin {
20
20
 
21
21
  public static final String TAG = "LiveUpdate";
22
- public static final String VERSION = "6.4.0";
22
+ public static final String VERSION = "6.4.1";
23
23
  public static final String SHARED_PREFERENCES_NAME = "CapawesomeLiveUpdate"; // DO NOT CHANGE
24
24
  public static final String ERROR_APP_ID_MISSING = "appId must be configured.";
25
25
  public static final String ERROR_BUNDLE_EXISTS = "bundle already exists.";
@@ -271,8 +271,15 @@ import CommonCrypto
271
271
  }
272
272
 
273
273
  private func deleteBundle(bundleId: String) throws {
274
+ // Delete the bundle directory
274
275
  let path = buildBundlePathFor(bundleId: bundleId)
275
276
  try FileManager.default.removeItem(atPath: path)
277
+ // Reset the next bundle if it is the deleted bundle
278
+ let currentBundleId = getCurrentBundleId()
279
+ let nextBundleId = getNextBundleId()
280
+ if bundleId == currentBundleId && bundleId == nextBundleId {
281
+ setNextCapacitorServerPathToDefaultWebAssetDir()
282
+ }
276
283
  }
277
284
 
278
285
  private func deleteUnusedBundles() {
@@ -8,7 +8,7 @@ import Capacitor
8
8
  @objc(LiveUpdatePlugin)
9
9
  public class LiveUpdatePlugin: CAPPlugin {
10
10
  public static let tag = "LiveUpdate"
11
- public static let version = "6.4.0"
11
+ public static let version = "6.4.1"
12
12
  public static let userDefaultsPrefix = "CapawesomeLiveUpdate" // DO NOT CHANGE
13
13
 
14
14
  private var config: LiveUpdateConfig?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/capacitor-live-update",
3
- "version": "6.4.0",
3
+ "version": "6.4.1",
4
4
  "description": "Capacitor plugin to update your app remotely in real-time.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",