refactor api controller to internalize server fetch

This commit is contained in:
jeffvli
2025-11-02 21:56:35 -08:00
parent 8dbaec3943
commit c7a473d864
79 changed files with 904 additions and 399 deletions
@@ -20,7 +20,7 @@ import {
import { DropdownMenu } from '/@/shared/components/dropdown-menu/dropdown-menu';
import { Icon } from '/@/shared/components/icon/icon';
import { toast } from '/@/shared/components/toast/toast';
import { ServerListItem, ServerType } from '/@/shared/types/domain-types';
import { ServerListItemWithCredential, ServerType } from '/@/shared/types/domain-types';
const browser = isElectron() ? window.api.browser : null;
const localSettings = isElectron() ? window.api.localSettings : null;
@@ -35,12 +35,12 @@ export const AppMenu = () => {
const { privateMode } = useAppStore();
const { setPrivateMode, setSideBar } = useAppStoreActions();
const handleSetCurrentServer = (server: ServerListItem) => {
const handleSetCurrentServer = (server: ServerListItemWithCredential) => {
navigate(AppRoute.HOME);
setCurrentServer(server);
};
const handleCredentialsModal = async (server: ServerListItem) => {
const handleCredentialsModal = async (server: ServerListItemWithCredential) => {
let password: null | string = null;
try {