Refactor main host setup
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
import type { BUN_SQLITE_WGUI_VARIABLES } from "@/db/types/db";
|
||||
import type { BUN_SQLITE_WGUI_HOSTS } from "@/db/types/db";
|
||||
|
||||
type Params = {
|
||||
variables?: BUN_SQLITE_WGUI_VARIABLES[];
|
||||
host?: BUN_SQLITE_WGUI_HOSTS;
|
||||
};
|
||||
|
||||
export default function checkIfMainHostIsSet({ variables }: Params) {
|
||||
const is_main_host_set =
|
||||
Boolean(
|
||||
variables?.find((v) => v.key == "main_host_wg_ip_address")?.value,
|
||||
) &&
|
||||
Boolean(
|
||||
variables?.find((v) => v.key == "main_host_wg_public_key")?.value,
|
||||
);
|
||||
|
||||
return is_main_host_set;
|
||||
export default function checkIfMainHostIsSet({ host }: Params) {
|
||||
return Boolean(host?.wg_ip_address);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user