Skip to content

Commit

Permalink
update lastOpenTime in onDestroy()
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Dec 19, 2024
1 parent 7a4913b commit 291700d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathC
e.printStackTrace();
}

long now = System.currentTimeMillis();
long timeDelta = now - lastOpenTime;
lastOpenTime = now;
long timeDelta = System.currentTimeMillis() - lastOpenTime;
final String url = this.baseURL + "/webxdc_bootstrap324567869.html?i=" + (internetAccess? "1" : "0") + "&href=" + encodedHref;
Util.runOnAnyBackgroundThread(() -> {
if (timeDelta < 2000) {Util.sleep(1000);}
Expand Down Expand Up @@ -265,6 +263,7 @@ protected void onPause() {

@Override
protected void onDestroy() {
lastOpenTime = System.currentTimeMillis();
DcHelper.getEventCenter(this.getApplicationContext()).removeObservers(this);
leaveRealtimeChannel();
super.onDestroy();
Expand Down

0 comments on commit 291700d

Please sign in to comment.