Skip to content

Commit 1c939df

Browse files
committed
Show loading spinner before initialization
1 parent b338d3e commit 1c939df

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/cloud/components/Router.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import AutomationCreatePage from '../pages/automations/create'
7272
import AutomationPage from '../pages/automations/[automationId]'
7373
import { BetaRegistrationProvider } from '../lib/stores/beta'
7474
import GithubSourceCallbackPage from './sources/GithubSourceCallbackPage'
75+
import Spinner from '../../design/components/atoms/Spinner'
7576

7677
const CombinedProvider = combineProviders(
7778
PreviewStyleProvider,
@@ -174,7 +175,8 @@ const Router = () => {
174175
.then((globalData) => {
175176
initGlobalData(globalData)
176177
})
177-
.catch((_err) => {
178+
.catch((error) => {
179+
console.warn(error)
178180
initGlobalData({
179181
teams: [],
180182
invites: [],
@@ -246,6 +248,20 @@ const Router = () => {
246248
}
247249
}, [pathname, search])
248250

251+
if (!initialized) {
252+
return (
253+
<PreferencesProvider>
254+
<GlobalDataProvider>
255+
<SettingsProvider>
256+
<V2ThemeProvider>
257+
<Spinner />
258+
</V2ThemeProvider>
259+
</SettingsProvider>
260+
</GlobalDataProvider>
261+
</PreferencesProvider>
262+
)
263+
}
264+
249265
if (pageInfo == null) {
250266
if (isApplicationPagePathname(pathname)) {
251267
return (

0 commit comments

Comments
 (0)