rename heartbeat indexedDB db name because key changed
This commit is contained in:
@@ -60,14 +60,6 @@ browser.tabs.onUpdated.addListener(async (tabId, changeInfo) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates IndexedDB
|
|
||||||
* https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
|
|
||||||
*/
|
|
||||||
self.addEventListener('activate', async () => {
|
|
||||||
await WakaTimeCore.db();
|
|
||||||
});
|
|
||||||
|
|
||||||
browser.runtime.onMessage.addListener(async (request: { task: string }, sender) => {
|
browser.runtime.onMessage.addListener(async (request: { task: string }, sender) => {
|
||||||
if (request.task === 'handleActivity') {
|
if (request.task === 'handleActivity') {
|
||||||
if (!sender.tab?.id) return;
|
if (!sender.tab?.id) return;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ describe('wakatime config', () => {
|
|||||||
"chrome://",
|
"chrome://",
|
||||||
"about:",
|
"about:",
|
||||||
],
|
],
|
||||||
"queueName": "heartbeatQueue",
|
"queueName": "heartbeatsQueue",
|
||||||
"socialMediaSites": [
|
"socialMediaSites": [
|
||||||
"facebook.com",
|
"facebook.com",
|
||||||
"instagram.com",
|
"instagram.com",
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ const config: Config = {
|
|||||||
|
|
||||||
nonTrackableSites: ['chrome://', 'about:'],
|
nonTrackableSites: ['chrome://', 'about:'],
|
||||||
|
|
||||||
queueName: 'heartbeatQueue',
|
queueName: 'heartbeatsQueue',
|
||||||
|
|
||||||
socialMediaSites: [
|
socialMediaSites: [
|
||||||
'facebook.com',
|
'facebook.com',
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class WakaTimeCore {
|
|||||||
* a library that adds promises to IndexedDB and makes it easy to use
|
* a library that adds promises to IndexedDB and makes it easy to use
|
||||||
*/
|
*/
|
||||||
async db() {
|
async db() {
|
||||||
return openDB('wakatime', 1, {
|
return openDB('wakatime', 2, {
|
||||||
upgrade(db) {
|
upgrade(db) {
|
||||||
db.createObjectStore(config.queueName, {
|
db.createObjectStore(config.queueName, {
|
||||||
keyPath: 'id',
|
keyPath: 'id',
|
||||||
|
|||||||
Reference in New Issue
Block a user