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.

feat(courses): replace invoke with pluginInvoke for session and course operations

Tonho213e70bba1c8
diff --git a/src/routes/courses/entregadigital/+page.svelte b/src/routes/courses/entregadigital/+page.svelte
index 18abcd04..6777c5b2 100644
--- a/src/routes/courses/entregadigital/+page.svelte
+++ b/src/routes/courses/entregadigital/+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";
@@ -78,7 +78,7 @@
async function checkSession() {
try {
- const result = await invoke<string>("entregadigital_check_session");
+ const result = await pluginInvoke<string>("courses", "entregadigital_check_session");
sessionEmail = result;
loggedIn = true;
loadCourses();
@@ -94,7 +94,7 @@
error = "";
loading = true;
try {
- const result = await invoke<string>("entregadigital_login_token", {
+ const result = await pluginInvoke<string>("courses", "entregadigital_login_token", {
token: token.trim(),
siteUrl: siteUrl.trim(),
appVersion: appVersion.trim(),
@@ -113,7 +113,7 @@
async function handleLogout() {
try {
- await invoke("entregadigital_logout");
+ await pluginInvoke("courses", "entregadigital_logout");
} catch {
}
loggedIn = false;
@@ -127,7 +127,7 @@
loadingCourses = true;
coursesError = "";
try {
- courses = await invoke("entregadigital_list_courses");
+ courses = await pluginInvoke("courses", "entregadigital_list_courses");
currentPage = 1;
} catch (e: any) {
coursesError = typeof e === "string" ? e : e.message ?? $t('hotmart.courses_error');
@@ -171,7 +171,7 @@
}
try {
- await invoke("start_entregadigital_course_download", {
+ await pluginInvoke("courses", "start_entregadigital_course_download", {
courseJson: JSON.stringify(course),
outputDir,
});
@@ -189,7 +189,7 @@
loadingCourses = true;
coursesError = "";
try {
- courses = await invoke("entregadigital_refresh_courses");
+ courses = await pluginInvoke("courses", "entregadigital_refresh_courses");
currentPage = 1;
} catch (e: any) {
coursesError = typeof e === "string" ? e : e.message ?? $t('hotmart.courses_error');