Chore/build npm (#9)

Co-authored-by: DigHuang <114602213+DigHuang@users.noreply.github.com>
Co-authored-by: Felix <24791380+vcfgv@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Haze
2026-02-09 15:10:08 +08:00
committed by GitHub
Unverified
parent 0b7f1c700e
commit de445ae3d5
37 changed files with 7359 additions and 1586 deletions

View File

@@ -2,7 +2,7 @@
* Channels Page
* Manage messaging channel connections with configuration UI
*/
import { useState, useEffect } from 'react';
import { useState, useEffect, useCallback } from 'react';
import {
Plus,
Radio,
@@ -71,7 +71,7 @@ export function Channels() {
}, [fetchChannels]);
// Fetch configured channel types from config file
const fetchConfiguredTypes = async () => {
const fetchConfiguredTypes = useCallback(async () => {
try {
const result = await window.electron.ipcRenderer.invoke('channel:listConfigured') as {
success: boolean;
@@ -83,11 +83,12 @@ export function Channels() {
} catch {
// ignore
}
};
}, []);
useEffect(() => {
fetchConfiguredTypes();
}, []);
// eslint-disable-next-line react-hooks/set-state-in-effect
void fetchConfiguredTypes();
}, [fetchConfiguredTypes]);
// Get channel types to display
const displayedChannelTypes = showAllChannels ? getAllChannels() : getPrimaryChannels();