summaryrefslogtreecommitdiff
path: root/contents/ui/kanvas.js
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2023-07-25 17:20:16 +0800
committerFrederick Yin <fkfd@fkfd.me>2023-07-25 17:20:16 +0800
commit5cc2aa76d0288390f1de4512d4dcff1ab4ac3806 (patch)
tree06e50289910cf133e0e44ad0ce867f3ec304acd5 /contents/ui/kanvas.js
parent5fdb94ddfed87d3c51e2e3e2c2433ad47b5e0d85 (diff)
Do not sync when offline
Diffstat (limited to 'contents/ui/kanvas.js')
-rw-r--r--contents/ui/kanvas.js3
1 files changed, 3 insertions, 0 deletions
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