• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 8536869866

03 Apr 2024 10:05AM CUT coverage: 21.234% (-0.3%) from 21.535%
8536869866

Pull #514

github

web-flow
Merge 91a25d710 into 45ee7ebb3
Pull Request #514: refactor: user and link selector

1394 of 2532 branches covered (55.06%)

27 of 1620 new or added lines in 60 files covered. (1.67%)

4 existing lines in 2 files now uncovered.

14588 of 68702 relevant lines covered (21.23%)

2.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.4
/packages/sdk/src/context/app/AppProvider.tsx
1
import { Hydrate, QueryClientProvider } from '@tanstack/react-query';
1✔
2
import type { DriverClient } from '@teable/core';
1✔
3
import { isObject, merge } from 'lodash';
1✔
4
import { useEffect, useMemo } from 'react';
1✔
5
import { AppContext } from '../app/AppContext';
1✔
6
import type { ILocalePartial } from './i18n';
1✔
7
import { defaultLocale } from './i18n';
1✔
8
import { createQueryClient } from './queryClient';
1✔
9
import { useConnection } from './useConnection';
1✔
10
import { useTheme } from './useTheme';
1✔
11

1✔
12
const queryClient = createQueryClient();
1✔
13

1✔
14
interface IAppProviderProps {
1✔
15
  children: React.ReactNode;
1✔
16
  wsPath?: string;
1✔
17
  lang?: string;
1✔
18
  locale?: ILocalePartial;
1✔
19
  driver: DriverClient;
1✔
20
  dehydratedState?: unknown;
1✔
21
}
1✔
22

1✔
23
export const AppProvider = (props: IAppProviderProps) => {
1✔
24
  const { children, wsPath, lang, locale, driver, dehydratedState } = props;
×
25

×
26
  const { connected, connection } = useConnection(wsPath);
×
27
  const themeProps = useTheme();
×
28

×
29
  useEffect(() => {
×
30
    if (!connection) {
×
31
      return;
×
32
    }
×
33
  }, [connection]);
×
34

×
35
  const value = useMemo(() => {
×
36
    return {
×
37
      connection,
×
38
      connected,
×
39
      driver,
×
40
      lang,
×
NEW
41
      locale: isObject(locale) ? merge(defaultLocale, locale) : defaultLocale,
×
42
      ...themeProps,
×
43
    };
×
44
  }, [connection, connected, driver, lang, locale, themeProps]);
×
45

×
46
  return (
×
47
    <AppContext.Provider value={value}>
×
48
      <QueryClientProvider client={queryClient}>
×
49
        <Hydrate state={dehydratedState}>{children}</Hydrate>
×
50
      </QueryClientProvider>
×
51
    </AppContext.Provider>
×
52
  );
×
53
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc