|
|
|
@ -188,7 +188,8 @@ struct CountdownEditView : View { |
|
|
|
|
|
|
|
|
|
|
|
cd.duration = self._minutes * 60.0 + self._seconds |
|
|
|
cd.duration = self._minutes * 60.0 + self._seconds |
|
|
|
if self._isAdding { |
|
|
|
if self._isAdding { |
|
|
|
cd.order = Int16(self.countdowns.count) |
|
|
|
let max = self.countdowns.map { $0.order }.max() ?? 0 |
|
|
|
|
|
|
|
cd.order = max + 1 |
|
|
|
} |
|
|
|
} |
|
|
|
if !self.nameString.isEmpty { |
|
|
|
if !self.nameString.isEmpty { |
|
|
|
cd.activity = CoreDataRequests.getOrCreateActivity(name: self.nameString) |
|
|
|
cd.activity = CoreDataRequests.getOrCreateActivity(name: self.nameString) |
|
|
|
|