Skip to content

Commit

Permalink
Fix #1160 #1155
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Feb 28, 2024
1 parent 11f23ff commit 81a3266
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions core/QuickAdd.vala
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ public class Layouts.QuickAdd : Adw.Bin {
css_classes = { "flat" }
};

content_entry = new Widgets.Entry () {
content_entry = new Gtk.Entry () {
hexpand = true,
placeholder_text = _("To-do name")
placeholder_text = _("To-do name"),
css_classes = { "flat" }
};

content_entry.add_css_class (Granite.STYLE_CLASS_FLAT);

var content_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
valign = Gtk.Align.CENTER,
hexpand = true,
Expand Down Expand Up @@ -279,8 +278,9 @@ public class Layouts.QuickAdd : Adw.Bin {
description_controller_key.key_pressed.connect ((keyval, keycode, state) => {
if ((ctrl_pressed || shift_pressed) && keyval == 65293) {
add_item ();
return true;
}

return false;
});

var event_controller_key = new Gtk.EventControllerKey ();
Expand Down
1 change: 1 addition & 0 deletions core/Services/CalDAV.vala
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ public class Services.CalDAV : GLib.Object {
var network_monitor = GLib.NetworkMonitor.get_default ();
network_monitor.network_changed.connect (() => {
if (GLib.NetworkMonitor.get_default ().network_available &&
is_logged_in () &&
Services.Settings.get_default ().settings.get_boolean ("caldav-sync-server")) {
sync_async ();
}
Expand Down
1 change: 1 addition & 0 deletions core/Services/Todoist.vala
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class Services.Todoist : GLib.Object {
var network_monitor = GLib.NetworkMonitor.get_default ();
network_monitor.network_changed.connect (() => {
if (GLib.NetworkMonitor.get_default ().network_available &&
is_logged_in () &&
Services.Settings.get_default ().settings.get_boolean ("todoist-sync-server")) {
sync_async ();
}
Expand Down
2 changes: 1 addition & 1 deletion src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public class MainWindow : Adw.ApplicationWindow {
});
});

if (!Services.Todoist.get_default ().invalid_token ()) {
if (Services.Todoist.get_default ().is_logged_in ()) {
Timeout.add (Constants.SYNC_TIMEOUT, () => {
Services.Todoist.get_default ().run_server ();
return GLib.Source.REMOVE;
Expand Down

0 comments on commit 81a3266

Please sign in to comment.