Skip to content

Commit 33d670d

Browse files
authored
fix: rewrites [skip cypress] (aave#1649)
* fix: rewrites * fix: rewrite
1 parent d0711f0 commit 33d670d

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

next.config.js

-8
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,4 @@ module.exports = withBundleAnalyzer({
3131
// assetPrefix: "./",
3232
trailingSlash: true,
3333
pageExtensions,
34-
async rewrites() {
35-
return [
36-
{
37-
source: '/collect/:match*',
38-
destination: 'https://api.mixpanel.com/:match*',
39-
},
40-
];
41-
},
4234
});

src/store/analyticsSlice.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ export type AnalyticsSlice = {
2525
mixpanelInitialized: boolean;
2626
};
2727

28-
export const MIXPANEL_API_HOST = '/collect';
29-
3028
export const createAnalyticsSlice: StateCreator<
3129
RootStore,
3230
[['zustand/subscribeWithSelector', never], ['zustand/devtools', never]],
@@ -65,15 +63,15 @@ export const createAnalyticsSlice: StateCreator<
6563

6664
if (userAcceptedAnalytics) {
6765
if (!isInitialized) {
68-
mixpanel.init(MIXPANEL_TOKEN, { api_host: MIXPANEL_API_HOST, ip: false });
66+
mixpanel.init(MIXPANEL_TOKEN, { ip: false });
6967
set({ mixpanelInitialized: true });
7068
}
7169

7270
mixpanel.opt_in_tracking();
7371
set({ isTrackingEnabled: true });
7472
} else {
7573
if (!isInitialized) {
76-
mixpanel.init(MIXPANEL_TOKEN, { api_host: MIXPANEL_API_HOST, ip: false });
74+
mixpanel.init(MIXPANEL_TOKEN, { ip: false });
7775
set({ mixpanelInitialized: true });
7876
}
7977
mixpanel.opt_out_tracking();

0 commit comments

Comments
 (0)