Skip to content

Commit

Permalink
Fix analytics preference
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitenite committed Sep 23, 2024
1 parent 5a25a1e commit 53657d4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export enum MainChannels {
CLOSE_TUNNEL = 'close-tunnel',

// Analytics
ANLYTICS_PREF_SET = 'analytics-pref-set',
UPDATE_ANALYTICS_PREFERENCE = 'update-analytics-preference',
SEND_ANALYTICS = 'send-analytics',

// Ast
Expand Down
2 changes: 1 addition & 1 deletion app/electron/main/events/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import analytics from '../analytics';
import { MainChannels } from '/common/constants';

export function listenForAnalyticsMessages() {
ipcMain.on(MainChannels.ANLYTICS_PREF_SET, (e: Electron.IpcMainInvokeEvent, args) => {
ipcMain.on(MainChannels.UPDATE_ANALYTICS_PREFERENCE, (e: Electron.IpcMainInvokeEvent, args) => {
const analyticsPref = args as boolean;
analytics.toggleSetting(analyticsPref);
});
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/Announcement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Announcement() {
function handleOpenChange(value: boolean) {
setOpen(false);
if (!value) {
window.api.send(MainChannels.ANLYTICS_PREF_SET, checked);
window.api.send(MainChannels.UPDATE_ANALYTICS_PREFERENCE, checked);
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/routes/projects/SettingsTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function SettingsTab() {
}

function updateAnalytics(enabled: boolean) {
window.api.invoke(MainChannels.UPDATE_USER_SETTINGS, { enableAnalytics: enabled });
window.api.send(MainChannels.UPDATE_ANALYTICS_PREFERENCE, enabled);
setIsAnalyticsEnabled(enabled);
}

Expand Down

0 comments on commit 53657d4

Please sign in to comment.