Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove enable time #2763

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Loading