Skip to content

Commit

Permalink
fix: remove enable time
Browse files Browse the repository at this point in the history
  • Loading branch information
heisenberg-2077 committed Jan 24, 2025
1 parent 5f2b844 commit 98ee46b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
21 changes: 2 additions & 19 deletions src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import rpcCache from './utils/rpcCache';
import { storage } from './webapi';
import { metamaskModeService } from './service/metamaskModeService';
import { ga4 } from '@/utils/ga4';
import { ALARMS_USER_ENABLE } from './utils/alarms';

Safe.adapter = fetchAdapter as any;

Expand Down Expand Up @@ -118,14 +117,9 @@ async function restoreAppState() {
syncChainService.roll();
transactionWatchService.roll();
transactionBroadcastWatchService.roll();
startEnableUser();
walletController.syncMainnetChainList();

// check if user has enabled the extension
chrome.alarms.create(ALARMS_USER_ENABLE, {
when: Date.now(),
periodInMinutes: 60,
});

if (!keyringService.isBooted()) {
userGuideService.init();
}
Expand Down Expand Up @@ -179,7 +173,7 @@ restoreAppState();
value: customTestnetLength,
});

ga4.fireEvent('Has Custom Network', {
ga4.fireEvent('Has_CustomNetwork', {
event_category: 'Custom Network',
});
}
Expand Down Expand Up @@ -429,10 +423,6 @@ declare global {
}

function startEnableUser() {
const time = preferenceService.getSendEnableTime();
if (dayjs(time).utc().isSame(dayjs().utc(), 'day')) {
return;
}
matomoRequestEvent({
category: 'User',
action: 'enable',
Expand All @@ -441,7 +431,6 @@ function startEnableUser() {
ga4.fireEvent('User_Enable', {
event_category: 'User Enable',
});
preferenceService.updateSendEnableTime(Date.now());
}

// On first install, open a new tab with Rabby
Expand All @@ -453,9 +442,3 @@ async function onInstall() {
await userGuideService.openUserGuide();
}
}

browser.alarms.onAlarm.addListener((alarm) => {
if (alarm.name === ALARMS_USER_ENABLE) {
startEnableUser();
}
});
1 change: 0 additions & 1 deletion src/background/utils/alarms.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const ALARMS_SYNC_CHAINS = 'ALARMS_SYNC_CHAINS';
export const ALARMS_SYNC_METAMASK_DAPPS = 'ALARMS_SYNC_METAMASK_DAPPS';
export const ALARMS_USER_ENABLE = 'ALARMS_USER_ENABLE';

0 comments on commit 98ee46b

Please sign in to comment.