Fix GRPC with files not refreshing, and tight render loop

This commit is contained in:
Gregory Schier
2024-06-20 08:40:10 -07:00
parent 92b1582232
commit 88aeb0e530
62 changed files with 221 additions and 163 deletions

View File

@@ -1,4 +1,3 @@
import { invoke } from '@tauri-apps/api/core';
import type {
CookieJar,
Environment,
@@ -8,14 +7,15 @@ import type {
Settings,
Workspace,
} from './models';
import { invokeCmd } from './tauri';
export async function getSettings(): Promise<Settings> {
return invoke('cmd_get_settings', {});
return invokeCmd('cmd_get_settings', {});
}
export async function getGrpcRequest(id: string | null): Promise<GrpcRequest | null> {
if (id === null) return null;
const request: GrpcRequest = (await invoke('cmd_get_grpc_request', { id })) ?? null;
const request: GrpcRequest = (await invokeCmd('cmd_get_grpc_request', { id })) ?? null;
if (request == null) {
return null;
}
@@ -24,7 +24,7 @@ export async function getGrpcRequest(id: string | null): Promise<GrpcRequest | n
export async function getHttpRequest(id: string | null): Promise<HttpRequest | null> {
if (id === null) return null;
const request: HttpRequest = (await invoke('cmd_get_http_request', { id })) ?? null;
const request: HttpRequest = (await invokeCmd('cmd_get_http_request', { id })) ?? null;
if (request == null) {
return null;
}
@@ -33,7 +33,7 @@ export async function getHttpRequest(id: string | null): Promise<HttpRequest | n
export async function getEnvironment(id: string | null): Promise<Environment | null> {
if (id === null) return null;
const environment: Environment = (await invoke('cmd_get_environment', { id })) ?? null;
const environment: Environment = (await invokeCmd('cmd_get_environment', { id })) ?? null;
if (environment == null) {
return null;
}
@@ -42,7 +42,7 @@ export async function getEnvironment(id: string | null): Promise<Environment | n
export async function getFolder(id: string | null): Promise<Folder | null> {
if (id === null) return null;
const folder: Folder = (await invoke('cmd_get_folder', { id })) ?? null;
const folder: Folder = (await invokeCmd('cmd_get_folder', { id })) ?? null;
if (folder == null) {
return null;
}
@@ -51,7 +51,7 @@ export async function getFolder(id: string | null): Promise<Folder | null> {
export async function getWorkspace(id: string | null): Promise<Workspace | null> {
if (id === null) return null;
const workspace: Workspace = (await invoke('cmd_get_workspace', { id })) ?? null;
const workspace: Workspace = (await invokeCmd('cmd_get_workspace', { id })) ?? null;
if (workspace == null) {
return null;
}
@@ -60,7 +60,7 @@ export async function getWorkspace(id: string | null): Promise<Workspace | null>
export async function getCookieJar(id: string | null): Promise<CookieJar | null> {
if (id === null) return null;
const cookieJar: CookieJar = (await invoke('cmd_get_cookie_jar', { id })) ?? null;
const cookieJar: CookieJar = (await invokeCmd('cmd_get_cookie_jar', { id })) ?? null;
if (cookieJar == null) {
return null;
}