finish core
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user