refactor: rewrite useAppConfig with RQ

This commit is contained in:
Rıdvan Akca
2024-03-07 18:13:18 +03:00
parent bd5aedd83f
commit 63b9943203
9 changed files with 72 additions and 71 deletions

View File

@@ -66,13 +66,14 @@ export default function Application() {
const connectionOptions = React.useMemo(() => {
const shouldHaveCustomConnection =
appConfig?.canConnect && appConfig?.canCustomConnect;
appConfig?.data?.canConnect && appConfig?.data?.canCustomConnect;
const options = [
{
label: formatMessage('app.addConnection'),
key: 'addConnection',
'data-test': 'add-connection-button',
to: URLS.APP_ADD_CONNECTION(appKey, appConfig?.canConnect),
to: URLS.APP_ADD_CONNECTION(appKey, appConfig?.data?.canConnect),
},
];
@@ -86,7 +87,7 @@ export default function Application() {
}
return options;
}, [appKey, appConfig]);
}, [appKey, appConfig?.data]);
if (loading) return null;
@@ -135,9 +136,9 @@ export default function Application() {
element={
<SplitButton
disabled={
appConfig &&
!appConfig?.canConnect &&
!appConfig?.canCustomConnect
appConfig?.data &&
!appConfig?.data?.canConnect &&
!appConfig?.data?.canCustomConnect
}
options={connectionOptions}
/>