Skip to content

Commit

Permalink
imp - Made use of the itemless bindings
Browse files Browse the repository at this point in the history
---

We've made use of itemless bindings to fix bugs concerning the Add command in the interactive TUIs.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jun 11, 2024
1 parent afe134f commit 8ea507d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using Nitrocid.Files.Editors.TextEdit;
using Textify.General;
using System.Linq;
using Terminaux.Inputs.Styles.Infobox;

namespace Nitrocid.Extras.Notes.Interactive
{
Expand All @@ -39,7 +38,7 @@ public class NoteViewerCli : BaseInteractiveTui<string>, IInteractiveTui<string>
[
// Operations
new InteractiveTuiBinding("Add", ConsoleKey.F1,
(_, _) => Add()),
(_, _) => Add(), true),
new InteractiveTuiBinding("Edit", ConsoleKey.F2,
(_, noteIdx) => Edit(noteIdx)),
new InteractiveTuiBinding("Remove", ConsoleKey.F3,
Expand Down
4 changes: 2 additions & 2 deletions public/Nitrocid/Misc/Interactives/AlarmCli.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal class AlarmCli : BaseInteractiveTui<string>, IInteractiveTui<string>
[
// Operations
new InteractiveTuiBinding("Add", ConsoleKey.A,
(_, _) => Start()),
(_, _) => Start(), true),
new InteractiveTuiBinding("Remove", ConsoleKey.Delete,
(saver, _) => Stop((string)saver)),
];
Expand Down Expand Up @@ -94,7 +94,7 @@ private static void Start()
return;
}
string interval = InfoBoxInputColor.WriteInfoBoxInput(Translate.DoTranslation("Write the alarm interval in this format") + ": HH:MM:SS");
if (TimeSpan.TryParse(interval, out TimeSpan span))
if (!TimeSpan.TryParse(interval, out TimeSpan span))
{
InfoBoxColor.WriteInfoBox(Translate.DoTranslation("Alarm interval is either not specified or is invalid."));
return;
Expand Down

0 comments on commit 8ea507d

Please sign in to comment.