chore(dashboard): render main layout as home page for v2 (#6823)
* chore(dashboard): render main layout as home page for v2 * chore: throw an error on store not existing
This commit is contained in:
@@ -8,7 +8,11 @@ export const useV2Store = ({ initialData }: { initialData?: any }) => {
|
||||
{ initialData }
|
||||
)
|
||||
|
||||
const store = data.stores[0]
|
||||
const store = data?.stores[0]
|
||||
|
||||
if (!isLoading && !isError && typeof store === "undefined") {
|
||||
throw new Error("Store does not exist")
|
||||
}
|
||||
|
||||
return { store, isLoading, isError, error }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user