Skip to content

Commit 3b1e6de

Browse files
authored
Merge pull request #378 from chromaui/debug-channel-fetch
Support disabling ChannelFetch using `--debug` flag
2 parents c0ca974 + 4353831 commit 3b1e6de

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Panel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ export const Panel = ({ active }: PanelProps) => {
8585
const trackEvent = useCallback((data: any) => emit(TELEMETRY, data), [emit]);
8686
const { isRunning, startBuild, stopBuild } = useBuildEvents({ localBuildProgress, accessToken });
8787

88-
const fetch = useChannelFetch();
88+
const channelFetch = useChannelFetch();
89+
const fetch = globalThis.LOGLEVEL === 'debug' ? globalThis.fetch : channelFetch;
8990
const withProviders = (children: React.ReactNode) => (
9091
<GraphQLClientProvider value={createClient({ fetch })}>
9192
<TelemetryProvider value={trackEvent}>

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { SelectedBuildFieldsFragment } from './gql/graphql';
66
declare global {
77
// eslint-disable-next-line no-var
88
var CONFIG_TYPE: string;
9+
// eslint-disable-next-line no-var
10+
var LOGLEVEL: string;
911
}
1012

1113
export type AnnouncedBuild = Extract<SelectedBuildFieldsFragment, { __typename: 'AnnouncedBuild' }>;

0 commit comments

Comments
 (0)