Skip to content

Commit

Permalink
fix: close dialog better
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Mar 19, 2024
1 parent b17aa5b commit 44db2c6
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,31 +360,31 @@ public void run() {

@PluginMethod
public void close(PluginCall call) {
if (webViewDialog != null) {
this.getActivity()
.runOnUiThread(
new Runnable() {
@Override
public void run() {
this.getActivity()
.runOnUiThread(
new Runnable() {
@Override
public void run() {
if (webViewDialog != null) {
notifyListeners(
"closeEvent",
new JSObject().put("url", webViewDialog.getUrl())
);
webViewDialog.dismiss();
webViewDialog.destroy();
webViewDialog = null;
} else {
Intent intent = new Intent(
getContext(),
getBridge().getActivity().getClass()
);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getContext().startActivity(intent);
}
call.resolve();
}
);
} else {
Intent intent = new Intent(
getContext(),
getBridge().getActivity().getClass()
}
);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getContext().startActivity(intent);
}
call.resolve();
}

private Bundle getHeaders(PluginCall pluginCall) {
Expand Down

0 comments on commit 44db2c6

Please sign in to comment.