summaryrefslogtreecommitdiff
path: root/services/Requests.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-11 22:34:04 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-11 22:34:04 +1000
commitca8c56d473c3c7d5af9f3122633890474ce9b1e8 (patch)
tree793f8abec53c4c65a984558f93646be8a1954c2b /services/Requests.qml
parentplugin: format + refactor (diff)
downloadcaelestia-shell-ca8c56d473c3c7d5af9f3122633890474ce9b1e8.tar.gz
caelestia-shell-ca8c56d473c3c7d5af9f3122633890474ce9b1e8.tar.bz2
caelestia-shell-ca8c56d473c3c7d5af9f3122633890474ce9b1e8.zip
plugin: add requests
Replaces QML Requests singleton
Diffstat (limited to 'services/Requests.qml')
-rw-r--r--services/Requests.qml36
1 files changed, 0 insertions, 36 deletions
diff --git a/services/Requests.qml b/services/Requests.qml
deleted file mode 100644
index a6a1d1d..0000000
--- a/services/Requests.qml
+++ /dev/null
@@ -1,36 +0,0 @@
-pragma Singleton
-
-import qs.config
-import qs.utils
-import Quickshell
-
-Singleton {
- id: root
-
- function get(url: string, callback: var): void {
- const xhr = new XMLHttpRequest();
-
- const cleanup = () => {
- xhr.abort();
- xhr.onreadystatechange = null;
- xhr.onerror = null;
- };
-
- xhr.open("GET", url, true);
- xhr.onreadystatechange = () => {
- if (xhr.readyState === XMLHttpRequest.DONE) {
- if (xhr.status === 200)
- callback(xhr.responseText);
- else
- console.warn(`[REQUESTS] GET request to ${url} failed with status ${xhr.status}`);
- cleanup();
- }
- };
- xhr.onerror = () => {
- console.warn(`[REQUESTS] GET request to ${url} failed`);
- cleanup();
- };
-
- xhr.send();
- }
-}