Skip to content

Commit

Permalink
fix: autoReset use better methods
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Apr 1, 2024
1 parent e03ce0b commit 2164d81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,7 @@ public Boolean set(final String id) {
}

public void autoReset() {
String id = this.prefs.getString(WebView.CAP_SERVER_PATH, "");

// Public means 1 thing - that this is a builtin bundle.
if (id.equals("public")) {
return;
}
String id = this.getCurrentBundleId();
final BundleInfo currentBundle = this.getBundleInfo(id);
if (!currentBundle.isBuiltin() && !this.bundleExists(id)) {
Log.i(TAG, "Folder at bundle path does not exist. Triggering reset.");
Expand Down
4 changes: 1 addition & 3 deletions ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,7 @@ extension CustomError: LocalizedError {
}

public func autoReset() {
guard let id: String = UserDefaults.standard.string(forKey: self.CAP_SERVER_PATH), !id.isEmpty else {
return
}
let id: String = self.getCurrentBundleId()
let currentBundle: BundleInfo = self.getBundleInfo(id: id)
if !currentBundle.isBuiltin() && !self.bundleExists(id: id) {
print("\(self.TAG) Folder at bundle path does not exist. Triggering reset.")
Expand Down

0 comments on commit 2164d81

Please sign in to comment.