Skip to content

Commit

Permalink
fix: logo ssr load failure
Browse files Browse the repository at this point in the history
  • Loading branch information
bs32g1038 committed Feb 28, 2023
1 parent 30fe251 commit 27df128
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ import Head from 'next/head';
class MyApp extends App {
public static getInitialProps = wrapper.getInitialAppProps((store) => async (context) => {
const res = await store.dispatch(fetchConfig.initiate());
await store.dispatch(fetchConfigSvg.initiate({ url: res.data.siteLogo }));
let url = res.data.siteLogo;
if (res.data.siteLogo.indexOf(res.data.siteDomain) > 0) {
url = res.data.siteLogo.substring(
res.data.siteLogo.indexOf(res.data.siteDomain) + res.data.siteDomain.length
);
}
await store.dispatch(fetchConfigSvg.initiate({ url }));
return {
pageProps: {
...(await App.getInitialProps(context)).pageProps,
Expand Down

0 comments on commit 27df128

Please sign in to comment.