@@ -27,7 +27,7 @@ class MyApp extends App {
27
27
}
28
28
29
29
if (
30
- ctx . pathname . includes ( '/your-settings' ) || // because of MenuWithLinks inside `Layout` HOC
30
+ ctx . pathname . includes ( '/your-settings' ) ||
31
31
ctx . pathname . includes ( '/team-settings' ) ||
32
32
ctx . pathname . includes ( '/discussion' ) ||
33
33
ctx . pathname . includes ( '/billing' )
@@ -52,6 +52,8 @@ class MyApp extends App {
52
52
53
53
const appProps = { pageProps } ;
54
54
55
+ console . log ( 'before getStore' ) ;
56
+
55
57
const store = getStore ( ) ;
56
58
if ( store ) {
57
59
return appProps ;
@@ -80,8 +82,6 @@ class MyApp extends App {
80
82
81
83
// console.log(initialData);
82
84
83
- // console.log(teamSlug);
84
-
85
85
let selectedTeamSlug = '' ;
86
86
87
87
if ( teamRequired ) {
@@ -93,24 +93,18 @@ class MyApp extends App {
93
93
let team ;
94
94
if ( initialData && initialData . teams ) {
95
95
team = initialData . teams . find ( ( t ) => {
96
- return t . slug === selectedTeamSlug ;
96
+ return t . slug === selectedTeamSlug || userObj . defaultTeamSlug ;
97
97
} ) ;
98
98
}
99
99
100
+ console . log ( initialData . teams , team ) ;
101
+
100
102
return {
101
103
...appProps ,
102
104
initialState : { user : userObj , currentUrl : ctx . asPath , team, teamSlug, ...initialData } ,
103
105
} ;
104
106
}
105
107
106
- public componentDidMount ( ) {
107
- // Remove the server-side injected CSS.
108
- const jssStyles = document . querySelector ( '#jss-server-side' ) ;
109
- if ( jssStyles && jssStyles . parentNode ) {
110
- jssStyles . parentNode . removeChild ( jssStyles ) ;
111
- }
112
- }
113
-
114
108
private store : Store ;
115
109
116
110
constructor ( props ) {
0 commit comments