Skip to content

Commit

Permalink
Merge pull request #1511 from byquanton/rewrite/offline-detection
Browse files Browse the repository at this point in the history
Rewrite Offline Mode
  • Loading branch information
alainm23 authored Jan 18, 2025
2 parents 455651e + 0890fca commit 41d18f8
Show file tree
Hide file tree
Showing 10 changed files with 289 additions and 267 deletions.
1 change: 1 addition & 0 deletions core/Objects/Source.vala
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public class Objects.Source : Objects.BaseObject {

public signal void sync_started ();
public signal void sync_finished ();
public signal void sync_failed ();

public Source.from_import_json (Json.Node node) {
id = node.get_object ().get_string_member ("id");
Expand Down
3 changes: 2 additions & 1 deletion core/Services/CalDAV/Core.vala
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ public class Services.CalDAV.Core : GLib.Object {
source.sync_finished ();
source.last_sync = new GLib.DateTime.now_local ().to_string ();
} catch (Error e) {
debug (e.message);
debug ("Failed to sync: " + e.message);
source.sync_failed ();
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/Services/Todoist.vala
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ public class Services.Todoist : GLib.Object {
yield queue (source);
}
} catch (Error e) {
debug (e.message);
debug ("Failed to sync: " + e.message);
source.sync_failed ();
}

source.last_sync = new GLib.DateTime.now_local ().to_string ();
Expand Down
Loading

0 comments on commit 41d18f8

Please sign in to comment.