mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Small fixes
This commit is contained in:
parent
09d7d6d0e7
commit
a97fd10e9c
2 changed files with 8 additions and 2 deletions
|
@ -127,11 +127,13 @@ public class AppLayoutModel {
|
|||
// null)
|
||||
));
|
||||
|
||||
var now = Instant.now();
|
||||
|
||||
var zone = ZoneId.of(ZoneId.SHORT_IDS.get("PST"));
|
||||
var now = Instant.now();
|
||||
var phStart = ZonedDateTime.of(2024, 10, 22, 0, 1, 0, 0, zone).toInstant();
|
||||
var phEnd = ZonedDateTime.of(2024, 10, 29, 0, 1, 0, 0, zone).toInstant();
|
||||
var clicked = AppCache.get("phClicked",Boolean.class,() -> false);
|
||||
var phShow = now.isAfter(phStart) && !clicked;
|
||||
var phShow = now.isAfter(phStart) && now.isBefore(phEnd) && !clicked;
|
||||
if (phShow) {
|
||||
l.add(new Entry(
|
||||
new SimpleStringProperty("Product Hunt"),
|
||||
|
|
|
@ -43,6 +43,10 @@ public class ContextMenuHelper {
|
|||
|
||||
public static void toggleShow(ContextMenu contextMenu, Node ref, Side side) {
|
||||
if (!contextMenu.isShowing()) {
|
||||
// Prevent NPE in show()
|
||||
if (contextMenu.getScene() == null || ref == null || ref.getScene() == null) {
|
||||
return;
|
||||
}
|
||||
contextMenu.show(ref, side, 0, 0);
|
||||
} else {
|
||||
contextMenu.hide();
|
||||
|
|
Loading…
Reference in a new issue