Commit a1b2c6e 1 parent b91be5e commit a1b2c6e Copy full SHA for a1b2c6e
File tree 5 files changed +36
-24
lines changed
5 files changed +36
-24
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,8 @@ const isOnboarding = () => {
319
319
};
320
320
321
321
const getQueryStatus = () => {
322
+ if (isServer) return ;
323
+
322
324
return new URLSearchParams (window .location .search ).get (' status' );
323
325
};
324
326
Original file line number Diff line number Diff line change @@ -138,16 +138,18 @@ const isDarkMode = ref(false);
138
138
onMounted (() => {
139
139
isClient .value = true ;
140
140
141
- window .matchMedia (' (prefers-color-scheme: dark)' ).addEventListener (' change' , (e ) => {
142
- isDarkMode .value = e .matches ;
143
- chartOptions .value = {
144
- title: {
145
- style: {
146
- color: e .matches ? ' #a3a3a3' : ' #0a0a0a' ,
141
+ if (isClient .value ) {
142
+ window .matchMedia (' (prefers-color-scheme: dark)' ).addEventListener (' change' , (e ) => {
143
+ isDarkMode .value = e .matches ;
144
+ chartOptions .value = {
145
+ title: {
146
+ style: {
147
+ color: e .matches ? ' #a3a3a3' : ' #0a0a0a' ,
148
+ }
147
149
}
148
150
}
149
- }
150
- });
151
+ });
152
+ }
151
153
});
152
154
153
155
const series = ref ([
Original file line number Diff line number Diff line change @@ -213,16 +213,18 @@ const isDarkMode = ref(false);
213
213
onMounted (() => {
214
214
isClient .value = true ;
215
215
216
- window .matchMedia (' (prefers-color-scheme: dark)' ).addEventListener (' change' , (e ) => {
217
- isDarkMode .value = e .matches ;
218
- chartOptions .value = {
219
- title: {
220
- style: {
221
- color: e .matches ? ' #a3a3a3' : ' #0a0a0a' ,
216
+ if (isClient .value ) {
217
+ window .matchMedia (' (prefers-color-scheme: dark)' ).addEventListener (' change' , (e ) => {
218
+ isDarkMode .value = e .matches ;
219
+ chartOptions .value = {
220
+ title: {
221
+ style: {
222
+ color: e .matches ? ' #a3a3a3' : ' #0a0a0a' ,
223
+ }
222
224
}
223
225
}
224
- }
225
- });
226
+ });
227
+ }
226
228
});
227
229
228
230
const series = ref ([
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ const form = useForm({
123
123
timezone: ' ' ,
124
124
});
125
125
126
+ const isServer = typeof window === ' undefined'
127
+
126
128
const submit = () => {
127
129
form .transform ((data ) => ({
128
130
... data,
@@ -140,6 +142,8 @@ const isOnboarding = () => {
140
142
};
141
143
142
144
const getQueryStatus = () => {
145
+ if (isServer) return ;
146
+
143
147
return new URLSearchParams (window .location .search ).get (' status' );
144
148
};
145
149
</script >
Original file line number Diff line number Diff line change @@ -204,16 +204,18 @@ const handleTimeframeChange = () => {
204
204
onMounted (() => {
205
205
isClient .value = true ;
206
206
207
- window .matchMedia (' (prefers-color-scheme: dark)' ).addEventListener (' change' , (e ) => {
208
- isDarkMode .value = e .matches ;
209
- chartOptions .value = {
210
- title: {
211
- style: {
212
- color: e .matches ? ' #a3a3a3' : ' #0a0a0a' ,
207
+ if (isClient .value ) {
208
+ window .matchMedia (' (prefers-color-scheme: dark)' ).addEventListener (' change' , (e ) => {
209
+ isDarkMode .value = e .matches ;
210
+ chartOptions .value = {
211
+ title: {
212
+ style: {
213
+ color: e .matches ? ' #a3a3a3' : ' #0a0a0a' ,
214
+ }
213
215
}
214
216
}
215
- }
216
- });
217
+ });
218
+ }
217
219
});
218
220
219
221
const series = ref ([
You can’t perform that action at this time.
0 commit comments