Skip to content

Commit

Permalink
fix: Call isReady
Browse files Browse the repository at this point in the history
In a previous attempt fda23d8 I managed
to try to fix the call to hideSplashScreen.

I fixed the call when the user had a magicFolder but without custom
shortcuts. But missed the case where the user doesn't have a magic
folder.

This is a TMP fix. I need to think about a better fix and mainly a way
to add a few UT to that method.
  • Loading branch information
Crash-- committed Jan 24, 2024
1 parent 9633ab1 commit 4313f8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/containers/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ const App = ({ accounts, konnectors, triggers }) => {
const homeShortcutsDirConn = mkHomeCustomShorcutsDirConn({
currentFolderId: magicHomeFolderId
})
const canHaveShortcuts = !!magicHomeFolderId
const { data: folders } = useQuery(homeShortcutsDirConn.query, {
...homeShortcutsDirConn.options,
enabled: !!magicHomeFolderId
enabled: canHaveShortcuts
})
const customHomeShortcutsConn = mkHomeCustomShorcutsConn(
folders && folders.map(folder => folder._id)
Expand All @@ -85,8 +86,9 @@ const App = ({ accounts, konnectors, triggers }) => {
enabled: Boolean(folders && folders.length > 0)
}
)

const shortcutsDirectories = formatShortcuts(folders, customHomeShortcuts)
const shortcutsDirectories = canHaveShortcuts
? formatShortcuts(folders, customHomeShortcuts)
: null
const context = useQuery(contextQuery.definition, contextQuery.options)

useEffect(() => {
Expand Down

0 comments on commit 4313f8a

Please sign in to comment.