Skip to content

Commit 5cc8b1b

Browse files
committed
2.0.2
fixes to timer afk
1 parent 20a5f24 commit 5cc8b1b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ configure(subprojects - project(':android')) {
2929
}
3030

3131
subprojects {
32-
version = '2.0.1'
32+
version = '2.0.2'
3333
ext.appName = 'Desku-App'
3434
repositories {
3535
mavenCentral()

core/src/main/java/com/osiris/jsqlgen/ui/timer/LayoutTimer.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.sql.Timestamp;
1919
import java.util.List;
20+
import java.util.Objects;
2021
import java.util.concurrent.atomic.AtomicBoolean;
2122
import java.util.concurrent.atomic.AtomicReference;
2223

@@ -55,16 +56,23 @@ public LayoutTimer() {
5556
isPendingAFKPopup = false;
5657
if(ui instanceof DesktopUI){
5758
try{
58-
ui.fullscreen(true);
59+
ui.maximize(true);
5960
ui.focus(true);
6061
} catch (Exception e) {
6162
throw new RuntimeException(e);
6263
}
6364
}
6465
Timer timer = Timer.whereId().biggestFirst().limit(1).getFirstOrNull();
65-
if(timer != null && timer.end != Timer.NULL){
66-
add(new SlidersPopup(true, timer));
66+
Objects.requireNonNull(timer);
67+
if(timer.end != Timer.NULL){
68+
timer.end = new Timestamp(msLastActivity);
69+
timer.update();
6770
}
71+
// Open the popup to determine the previous actual work timer work amount
72+
add(new SlidersPopup(true, timer));
73+
// Create a timer for the AFK portion
74+
timer = Timer.createAndAdd(new Timestamp(msLastActivity), new Timestamp(System.currentTimeMillis()));
75+
add(new SlidersPopup(true, timer));
6876
});
6977
};
7078
refresh();

0 commit comments

Comments
 (0)