Skip to content

Commit

Permalink
Log the installed event on installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunnini committed Apr 12, 2024
1 parent 6bd91d9 commit cf57d93
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/extension/src/background/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {
ExtensionGuards,
ExtensionEnv,
ContentScriptMessageRequester,
InExtensionMessageRequester,
} from "@keplr-wallet/router-extension";
import { ExtensionKVStore } from "@keplr-wallet/common";
import { init } from "@keplr-wallet/background";
import { init, LogAnalyticsEventMsg } from "@keplr-wallet/background";
import scrypt from "scrypt-js";
import { Buffer } from "buffer/";
import { Bech32Address } from "@keplr-wallet/cosmos";
Expand Down Expand Up @@ -350,6 +351,19 @@ router.listen(BACKGROUND_PORT, initFn).then(() => {
}
}
});

kvStore.get("installed_analytics").then((v) => {
if (!v) {
kvStore.set("installed_analytics", true);

const msg = new LogAnalyticsEventMsg("installed", {
version: browser.runtime.getManifest().version,
});

const requester = new InExtensionMessageRequester();
requester.sendMessage(BACKGROUND_PORT, msg);
}
});
});

browser.alarms.create("keep-alive-alarm", {
Expand Down

0 comments on commit cf57d93

Please sign in to comment.