mirror of
https://github.com/dw-0/kiauh.git
synced 2026-08-03 12:57:53 +05:00
fix(webui_client): get_existing_clients always returns an empty list
This commit is contained in:
@@ -14,10 +14,10 @@ import shutil
|
||||
from json import JSONDecodeError
|
||||
from pathlib import Path
|
||||
from subprocess import PIPE, CalledProcessError, run
|
||||
from typing import List, get_args
|
||||
from typing import List
|
||||
|
||||
from components.klipper.klipper import Klipper
|
||||
from components.webui_client import MODULE_PATH
|
||||
from components.webui_client import CLIENTS, MODULE_PATH
|
||||
from components.webui_client.base_data import (
|
||||
BaseWebClient,
|
||||
BaseWebClientConfig,
|
||||
@@ -230,13 +230,8 @@ def backup_client_config_data(client: BaseWebClient) -> None:
|
||||
|
||||
|
||||
def get_existing_clients() -> List[BaseWebClient]:
|
||||
clients = list(get_args(WebClientType))
|
||||
installed_clients: List[BaseWebClient] = []
|
||||
for client in clients:
|
||||
if client.client_dir.exists():
|
||||
installed_clients.append(client)
|
||||
|
||||
return installed_clients
|
||||
clients: List[BaseWebClient] = [bwc() for bwc in CLIENTS.values()]
|
||||
return [client for client in clients if client.client_dir.exists()]
|
||||
|
||||
|
||||
def detect_client_cfg_conflict(curr_client: BaseWebClient) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user