Skip to content

Commit

Permalink
fix: remove versionName from next
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jun 29, 2022
1 parent 642e9e8 commit 7df3471
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,12 @@ public void reload(final PluginCall call) {
@PluginMethod
public void next(final PluginCall call) {
final String folder = call.getString("folder");
final String versionName = call.getString("versionName", "");

try {
Log.i(CapacitorUpdater.TAG, "Setting next active folder " + folder);
if (!this.implementation.setNextVersion(folder)) {
call.reject("Set next folder failed. Version " + folder + " does not exist.");
} else {
if(!"".equals(versionName)) {
this.implementation.setVersionName(folder, versionName);
}
call.resolve(this.implementation.getVersionInfo(folder).toJSON());
}
} catch (final Exception e) {
Expand Down
6 changes: 0 additions & 6 deletions ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,11 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
call.reject("Next called without folder")
return
}
guard let versionName = call.getString("versionName") else {
print("\(self.implementation.TAG) Next called without versionName")
call.reject("Next called without versionName")
return
}

print("\(self.implementation.TAG) Setting next active folder \(folder)")
if (!self.implementation.setNextVersion(next: folder)) {
call.reject("Set next version failed. folder \(folder) does not exist.")
} else {
self.implementation.setVersionName(folder: folder, versionName: versionName)
call.resolve(self.implementation.getVersionInfo(folder: folder).toJSON())
}
}
Expand Down

0 comments on commit 7df3471

Please sign in to comment.