Skip to content

Commit

Permalink
fix: disable delete active
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 28, 2022
1 parent 31c2f5b commit 7f52870
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ public List<BundleInfo> list() {

public Boolean delete(final String id, final Boolean removeInfo) throws IOException {
final BundleInfo deleted = this.getBundleInfo(id);
if (deleted.isBuiltin()) {
if (deleted.isBuiltin() || self.getCurrentBundleId() == id) {
Log.e(TAG, "Cannot delete " + id);
return false;
}
final File bundle = new File(this.documentsDir, bundleDirectory + "/" + id);
Expand Down
3 changes: 2 additions & 1 deletion ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ extension CustomError: LocalizedError {

public func delete(id: String, removeInfo: Bool) -> Bool {
let deleted: BundleInfo = self.getBundleInfo(id: id)
if (deleted.isBuiltin()) {
if (deleted.isBuiltin() || self.getCurrentBundleId() == id) {
print("\(self.TAG) Cannot delete \(id)")
return false
}
let destHot = documentsDir.appendingPathComponent(bundleDirectoryHot).appendingPathComponent(id)
Expand Down

0 comments on commit 7f52870

Please sign in to comment.