How to use the electron-settings.get function in electron-settings

To help you get started, we’ve selected a few electron-settings examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github VertigoRay / GDAXBot / js / script.js View on Github external
function shouldBuy(product_id) {
    if (settings.get(product_id +'_buy_on_trend_long_up') && settings.get(product_id +'_buy_on_trend_short_up')) {
        // Buy only on trend up, BOTH
        return (varIsTrendingUp['long'][product_id] && varIsTrendingUp['short'][product_id]) ? true : false
    } else if (settings.get(product_id +'_buy_on_trend_long_up')) {
        // Buy only on trend up, LONG
        return (varIsTrendingUp['long'][product_id]) ? true : false
    } else if (settings.get(product_id +'_buy_on_trend_short_up')) {
        // Buy only on trend up, SHORT
        return (varIsTrendingUp['short'][product_id]) ? true : false
    } else {
        // Always buy
        return true
    }
}
github tobias-klein / ezra-project / app / helpers / db_helper.js View on Github external
getDatabaseDir() {
    var databaseDir = this.userDataDir;
    
    if (settings.has('custom_database_dir') &&
      settings.get('custom_database_dir') != null) {

      databaseDir = settings.get('custom_database_dir');
      console.log('Using custom database dir ' + databaseDir + ' for database access!');
    } else {
      console.log('Using default database dir ' + databaseDir + ' for database access!');
    }

    return databaseDir;
  }
github dvx / lofi / src / renderer / components / Lofi / index.tsx View on Github external
constructor(props: any) {
    super(props);

    this.state = {
      access_token: settings.get('spotify.access_token'),
      refresh_token: settings.get('spotify.refresh_token'),
      window_side: SIDE.LEFT,
      auth: false,
    }
  }
github yjlintw / comic-reader / renderer-process / viewmodels / subscribe-viewmodel.js View on Github external
function hasSubscription() {
    all_comic_data = settings.get('comic');
    if (all_comic_data == undefined) return false;

    for (let host in all_comic_data) {
        for (let comic in all_comic_data[host]) {
            if (all_comic_data[host][comic].subscribed) {
                return true;
            }
        }
    }

    return false;
}
github WeeJeWel / decoravit / main.js View on Github external
function getOpt( key ) {
		let value = settings.get(key);
		if( typeof value === 'undefined' ) return defaultOpts[ key ];
		return value;
	}
github yjlintw / comic-reader / renderer-process / viewmodels / subscribe-viewmodel.js View on Github external
function subscribe(host, titlekey, title, link, thumbnail_uri) {
    let keyPath = "comic." + host + "." + titlekey;
    let comic_data = settings.get(keyPath);
    if (comic_data) {
        
        comic_data.subscribed = !comic_data.subscribed;
        settings.set(keyPath, comic_data);
    } else {
        comic_data = register(host, titlekey, title, link, thumbnail_uri, true)
    }
    if (comic_data.subscribed) {
        checkUpdateSingle(host, titlekey);
    }
    updateSubscribeUIStatus();

}
github yjlintw / comic-reader / renderer-process / viewmodels / subscribe-viewmodel.js View on Github external
function unsubscribe(host, titlekey) {
    let key_path = "comic." + host + "." + titlekey;
    let comicData = settings.get(key_path);
    if (comicData) {
        comicData.subscribed = false;
        settings.set(key_path, comicData);
        updateSubscribeUIStatus();
    }
}
github eNkru / electron-xiami / src / controller / player-controller.js View on Github external
notify(trackName, singers, albumName, albumLogo) {
    const showNotification = settings.get('showNotification', 'check');
    if ('check' === showNotification) {
      const title = `${Locale.NOTIFICATION_TRACK}: ${trackName}`;
      const body = `${Locale.NOTIFICATION_ARTIST}: ${singers}
${Locale.NOTIFICATION_ALBUM}: ${albumName}`;
      this.notificationController.notify(albumLogo, title, body);
    }
  }

electron-settings

A simple and robust settings management library for Electron.

MIT
Latest version published 14 days ago

Package Health Score

75 / 100
Full package analysis