[Update/Refactor] Fetch and show the plugins info list.
Refactor some functions. Try to fetch functions from github api just once when vrct started.(It used to every time plugin tab has opened so easy to reach to the api limit)
This commit is contained in:
21
src-ui/logics/common/useFetch.js
Normal file
21
src-ui/logics/common/useFetch.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { fetch as tauriFetch, ResponseType } from "@tauri-apps/api/http";
|
||||
|
||||
export const useFetch = () => {
|
||||
const asyncTauriFetchGithub = async (url) => {
|
||||
console.log("tauriFetch");
|
||||
|
||||
const release_response = await tauriFetch(url, {
|
||||
method: "GET",
|
||||
responseType: ResponseType.Json,
|
||||
headers: {
|
||||
"Accept": "application/vnd.github+json",
|
||||
"User-Agent": "VRCTPluginApp"
|
||||
}
|
||||
});
|
||||
return release_response;
|
||||
};
|
||||
|
||||
return {
|
||||
asyncTauriFetchGithub,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user