Fix linting
This commit is contained in:
@@ -427,10 +427,12 @@ def create_app(args):
|
||||
class NoCacheStaticFiles(StaticFiles):
|
||||
async def get_response(self, path: str, scope):
|
||||
response = await super().get_response(path, scope)
|
||||
if path.endswith('.html'):
|
||||
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
|
||||
response.headers['Pragma'] = 'no-cache'
|
||||
response.headers['Expires'] = '0'
|
||||
if path.endswith(".html"):
|
||||
response.headers["Cache-Control"] = (
|
||||
"no-cache, no-store, must-revalidate"
|
||||
)
|
||||
response.headers["Pragma"] = "no-cache"
|
||||
response.headers["Expires"] = "0"
|
||||
return response
|
||||
|
||||
# Webui mount webui/index.html
|
||||
|
@@ -9,10 +9,10 @@ import { useTranslation } from 'react-i18next'
|
||||
export default function AppSettings() {
|
||||
const [opened, setOpened] = useState<boolean>(false)
|
||||
const { t } = useTranslation()
|
||||
|
||||
|
||||
const language = useSettingsStore.use.language()
|
||||
const setLanguage = useSettingsStore.use.setLanguage()
|
||||
|
||||
|
||||
const theme = useSettingsStore.use.theme()
|
||||
const setTheme = useSettingsStore.use.setTheme()
|
||||
|
||||
|
@@ -34,10 +34,10 @@ export default function ThemeProvider({ children, ...props }: ThemeProviderProps
|
||||
root.classList.remove('light', 'dark')
|
||||
root.classList.add(e.matches ? 'dark' : 'light')
|
||||
}
|
||||
|
||||
|
||||
root.classList.add(mediaQuery.matches ? 'dark' : 'light')
|
||||
mediaQuery.addEventListener('change', handleChange)
|
||||
|
||||
|
||||
return () => mediaQuery.removeEventListener('change', handleChange)
|
||||
} else {
|
||||
root.classList.add(theme)
|
||||
|
@@ -54,9 +54,9 @@ const GraphLabels = () => {
|
||||
|
||||
const setQueryLabel = useCallback((newLabel: string) => {
|
||||
if (newLabel.startsWith('And ') && newLabel.endsWith(' others')) return
|
||||
|
||||
|
||||
const currentLabel = useSettingsStore.getState().queryLabel
|
||||
|
||||
|
||||
if (newLabel === '*' && currentLabel === '*') {
|
||||
// When reselecting '*', just set it again to trigger a new fetch
|
||||
useSettingsStore.getState().setQueryLabel('*')
|
||||
|
@@ -25,7 +25,7 @@ const TooltipContent = React.forwardRef<
|
||||
}
|
||||
>(({ className, side = 'left', align = 'start', children, ...props }, ref) => {
|
||||
const contentRef = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
|
||||
React.useEffect(() => {
|
||||
if (contentRef.current) {
|
||||
contentRef.current.scrollTop = 0;
|
||||
|
@@ -178,8 +178,8 @@ const useLightrangeGraph = () => {
|
||||
// Reset fetch status only when parameters actually change
|
||||
useEffect(() => {
|
||||
const prevParams = prevParamsRef.current;
|
||||
if (prevParams.queryLabel !== queryLabel ||
|
||||
prevParams.maxQueryDepth !== maxQueryDepth ||
|
||||
if (prevParams.queryLabel !== queryLabel ||
|
||||
prevParams.maxQueryDepth !== maxQueryDepth ||
|
||||
prevParams.minDegree !== minDegree) {
|
||||
useGraphStore.getState().setIsFetching(false);
|
||||
// Reset fetch status for new parameters
|
||||
@@ -206,7 +206,7 @@ const useLightrangeGraph = () => {
|
||||
useEffect(() => {
|
||||
if (queryLabel) {
|
||||
const fetchKey = `${queryLabel}-${maxQueryDepth}-${minDegree}`;
|
||||
|
||||
|
||||
// Only fetch if we haven't fetched this combination in the current component lifecycle
|
||||
if (!isFetching && !fetchStatusRef.current[fetchKey]) {
|
||||
useGraphStore.getState().setIsFetching(true);
|
||||
@@ -215,13 +215,13 @@ const useLightrangeGraph = () => {
|
||||
const state = useGraphStore.getState()
|
||||
const newSigmaGraph = createSigmaGraph(data)
|
||||
data?.buildDynamicMap()
|
||||
|
||||
|
||||
// Update all graph data at once to minimize UI flicker
|
||||
state.clearSelection()
|
||||
state.setMoveToSelectedNode(false)
|
||||
state.setSigmaGraph(newSigmaGraph)
|
||||
state.setRawGraph(data)
|
||||
|
||||
|
||||
// Extract labels from graph data
|
||||
if (data) {
|
||||
const labelSet = new Set<string>();
|
||||
|
@@ -129,7 +129,7 @@ const useGraphStoreBase = create<GraphState>()((set) => ({
|
||||
}),
|
||||
|
||||
setSigmaGraph: (sigmaGraph: DirectedGraph | null) => set({ sigmaGraph }),
|
||||
|
||||
|
||||
setGraphLabels: (labels: string[]) => set({ graphLabels: labels }),
|
||||
|
||||
setMoveToSelectedNode: (moveToSelectedNode?: boolean) => set({ moveToSelectedNode })
|
||||
|
Reference in New Issue
Block a user