Skip to content

Commit

Permalink
do not check for new version every application startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogefest committed Apr 11, 2021
1 parent 19bb072 commit 067820b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/notepack/app/task/NewVersionCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ public int getInterval() {
@Override
public void guiWork(TaskUtil taskUtil, App app) throws GuiNotReadyError {
AnchorPane pane;

String lastCheckTimestamp = app.getSettings().get("last-check-timestamp", "0");
long lastCheckTs = Long.parseLong(lastCheckTimestamp);
long currentTs = System.currentTimeMillis() / 1000L;
if (lastCheckTs + 3600 > currentTs) {
return;
}
app.getSettings().set("last-check-timestamp", Long.toString(currentTs));

try {

FXMLLoader loader = new FXMLLoader(getClass().getResource("/notepack/NewVersionPopup.fxml"));
Expand Down

0 comments on commit 067820b

Please sign in to comment.