finish core

This commit is contained in:
Alan Hamlett
2024-08-27 20:36:44 +02:00
parent 9820c22a28
commit 4d08aeb2fe
11 changed files with 178 additions and 179 deletions

View File

@@ -1,6 +1,3 @@
import browser from 'webextension-polyfill';
import config from '../config/config';
export default function apiKeyInvalid(key?: string): string {
const err = 'Invalid api key... check https://wakatime.com/settings for your key';
if (!key) return err;
@@ -11,11 +8,3 @@ export default function apiKeyInvalid(key?: string): string {
if (!re.test(key)) return err;
return '';
}
export async function getApiKey(): Promise<string> {
const storage = await browser.storage.sync.get({
apiKey: config.apiKey,
});
const apiKey = storage.apiKey as string;
return apiKey;
}