Skip to content

Commit

Permalink
use local storage for DEBUG status
Browse files Browse the repository at this point in the history
  • Loading branch information
opus1269 committed May 17, 2019
1 parent bcf091f commit b180eca
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/**
* Utility methods
*
* @remarks
* If you want to log events, errors, etc. locally during development,
* save a true boolean key named isDevelopmentBuild to local storage
*
* @module chrome/utils
*/

Expand All @@ -14,21 +18,13 @@
*/

import * as ChromeLocale from './locales.js';
import * as ChromeStorage from './storage.js';

declare var ChromePromise: any;
const chromep = new ChromePromise();

/**
* Set to true if development build
*
* @remarks
*
* Do not change name as it is processed during build
*/
const _DEBUG = false;

/** True if development build */
export const DEBUG = _DEBUG;
export const DEBUG = ChromeStorage.getBool('isDevelopmentBuild', false);

/** Get the extension's name
*
Expand Down Expand Up @@ -157,6 +153,7 @@ export function isWhiteSpace(str: string | null | undefined) {
* @returns A pseudo-random string
*/
export function getRandomString(len = 8) {
// noinspection SpellCheckingInspection
const POSS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let text = '';
for (let i = 0; i < len; i++) {
Expand Down

0 comments on commit b180eca

Please sign in to comment.