Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions timetagger/app/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,10 +1069,10 @@ def onchanged(self, action):
mm, ss = mm + self._stepwise_delta(mm, -(_stepsize)), 0
d1 = window.Date(year1, month1 - 1, day1, hh, mm, ss)
self.t1 = dt.to_time_int(d1)
if self.ori_t1 == self.ori_t2:
self.t2 = self.t1 = min(self.t1, now)
elif self.t1 >= self.t2:
self.t2 = self.t1 + 1
if self.ori_t1 == self.ori_t2:
self.t2 = self.t1 = min(self.t1, now)
elif self.t1 >= self.t2:
self.t2 = self.t1 + 1

elif what == "time2":
# Changing time2 -> update t2, keep t1 and t2 in check
Expand All @@ -1091,11 +1091,11 @@ def onchanged(self, action):
mm, ss = mm + self._stepwise_delta(mm, -(_stepsize)), 0
d2 = window.Date(year2, month2 - 1, day2, hh, mm, ss)
self.t2 = dt.to_time_int(d2)
if self.ori_t1 == self.ori_t2:
self.t2 = self.t1
elif self.t2 <= self.t1:
self.t1 = self.t2
self.t2 = self.t1 + 1
if self.ori_t1 == self.ori_t2:
self.t2 = self.t1
elif self.t2 <= self.t1:
self.t1 = self.t2
self.t2 = self.t1 + 1

elif what == "duration":
# Changing duration -> update t2, but keep it in check
Expand All @@ -1115,7 +1115,8 @@ def onchanged(self, action):

# Invoke callback and rerender
if call_callback:
window.setTimeout(self.callback, 1)
self.callback() # direct callback to avoid race condition #583
# window.setTimeout(self.callback, 1000)

if action.endswith("fast"):
self._update_duration(True)
Expand Down