mirror of
https://github.com/cupcakearmy/ora.git
synced 2025-09-06 08:10:40 +00:00
dismiss & use svelte in client
This commit is contained in:
@@ -4,6 +4,7 @@ import dayjs from 'dayjs'
|
||||
import { dashboard } from '../shared/utils'
|
||||
import { insertLog, normalizeTimestamp, DB } from '../shared/db'
|
||||
import { getSettingsWithDefaults, getUsageForHost, percentagesToBool } from '../shared/lib'
|
||||
import { DismissValidator, checkForErrors } from '../shared/validation'
|
||||
|
||||
browser.browserAction.onClicked.addListener(() => browser.tabs.create({ url: dashboard, active: true }))
|
||||
|
||||
@@ -65,5 +66,13 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
case 'report':
|
||||
DB.settings.put({ key: 'lastActivity', value: new Date() })
|
||||
break
|
||||
case 'dismiss':
|
||||
const entry = {
|
||||
host: message.host,
|
||||
timestamp: new Date(),
|
||||
duration: message.duration,
|
||||
}
|
||||
if (!checkForErrors(DismissValidator, entry)) DB.dismiss.put(entry)
|
||||
break
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user