From 5cc2aa76d0288390f1de4512d4dcff1ab4ac3806 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Tue, 25 Jul 2023 17:20:16 +0800 Subject: Do not sync when offline --- contents/ui/kanvas.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contents/ui/kanvas.js') diff --git a/contents/ui/kanvas.js b/contents/ui/kanvas.js index 3162474..dbd2526 100644 --- a/contents/ui/kanvas.js +++ b/contents/ui/kanvas.js @@ -31,6 +31,9 @@ function callApi(path, perPage, callback) { } function syncCanvas() { + if (networkStatus.networkStatus != "Connected") { + return; + } const courses = plasmoid.configuration.courses.split("\n").map( // each line in the "courses" config consists of // a numeric course id, a space, and a course code -- cgit v1.2.3