mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): handle the getSession network error properly (#4909)
If network offline or API error happens, the `session` returned by the `useSession` hook will be null, so we can't assume it is not null. There should be following changes: 1. create a page in ErrorBoundary to let the user refetch the session. 2. The `SessionProvider` stop to pull the new session once the session is null, we need to figure out a way to pull the new session when the network is back or the user click the refetch button.
This commit is contained in:
@@ -114,7 +114,10 @@ export const createConfiguration: (
|
||||
buildFlags.mode === 'production'
|
||||
? 'js/chunk.[name]-[contenthash:8].js'
|
||||
: 'js/chunk.[name].js',
|
||||
assetModuleFilename: 'assets/[name]-[contenthash:8][ext][query]',
|
||||
assetModuleFilename:
|
||||
buildFlags.mode === 'production'
|
||||
? 'assets/[name]-[contenthash:8][ext][query]'
|
||||
: '[name][ext]',
|
||||
devtoolModuleFilenameTemplate: 'webpack://[namespace]/[resource-path]',
|
||||
hotUpdateChunkFilename: 'hot/[id].[fullhash].js',
|
||||
hotUpdateMainFilename: 'hot/[runtime].[fullhash].json',
|
||||
@@ -292,7 +295,7 @@ export const createConfiguration: (
|
||||
},
|
||||
},
|
||||
],
|
||||
exclude: [/node_modules/],
|
||||
exclude: [/node_modules/, /\.assets\.svg$/],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|gif|svg|webp|mp4)$/,
|
||||
|
||||
Reference in New Issue
Block a user