Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

refactor: replace invoke with pluginInvoke for Thinkific API calls

Tonho246105ac1ce9
diff --git a/src/routes/courses/thinkific/+page.svelte b/src/routes/courses/thinkific/+page.svelte
index e8f19166..a6c7dba0 100644
--- a/src/routes/courses/thinkific/+page.svelte
+++ b/src/routes/courses/thinkific/+page.svelte
@@ -1,5 +1,5 @@
<script lang="ts">
- import { invoke } from "@tauri-apps/api/core";
+ import { pluginInvoke } from "$lib/plugin-invoke";
import { open } from "@tauri-apps/plugin-dialog";
import CourseCard from "$components/hotmart/CourseCard.svelte";
import { showToast } from "$lib/stores/toast-store.svelte";
@@ -75,7 +75,7 @@
async function checkSession() {
try {
- const result = await invoke<string>("thinkific_check_session");
+ const result = await pluginInvoke<string>("courses", "thinkific_check_session");
sessionSiteUrl = result;
loggedIn = true;
loadCourses();
@@ -91,7 +91,7 @@
error = "";
loading = true;
try {
- const result = await invoke<string>("thinkific_login", {
+ const result = await pluginInvoke<string>("courses", "thinkific_login", {
cookies: cookies.trim(),
siteUrl: siteUrl.trim(),
});
@@ -107,7 +107,7 @@
async function handleLogout() {
try {
- await invoke("thinkific_logout");
+ await pluginInvoke("courses", "thinkific_logout");
} catch {
}
loggedIn = false;
@@ -121,7 +121,7 @@
loadingCourses = true;
coursesError = "";
try {
- courses = await invoke("thinkific_list_courses");
+ courses = await pluginInvoke("courses", "thinkific_list_courses");
currentPage = 1;
} catch (e: any) {
coursesError = typeof e === "string" ? e : e.message ?? $t('hotmart.courses_error');
@@ -177,7 +177,7 @@
}
try {
- await invoke("start_thinkific_course_download", {
+ await pluginInvoke("courses", "start_thinkific_course_download", {
courseJson: JSON.stringify(course),
outputDir,
});
@@ -195,7 +195,7 @@
loadingCourses = true;
coursesError = "";
try {
- courses = await invoke("thinkific_refresh_courses");
+ courses = await pluginInvoke("courses", "thinkific_refresh_courses");
currentPage = 1;
} catch (e: any) {
coursesError = typeof e === "string" ? e : e.message ?? $t('hotmart.courses_error');