Skip to content

Commit

Permalink
fix setting default query limit in core
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
  • Loading branch information
MasterOdin committed Feb 17, 2021
1 parent c696cc8 commit ba1e062
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/browser/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint global-require:0, no-var: 0, no-extend-native: 0, vars-on-top: 0 */
const sqlectron = require('sqlectron-core');
var config = require('./config');

var configData = config.get();
Expand All @@ -8,6 +9,13 @@ if (configData.printVersion) {
process.exit(0);
}

if (
configData.limitQueryDefaultSelectTop !== undefined
&& configData.limitQueryDefaultSelectTop !== null
) {
sqlectron.setSelectLimit();
}

// enables ES6+ support
if (configData.devMode) {
require('@babel/register');
Expand Down
1 change: 1 addition & 0 deletions src/renderer/actions/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function saveConfig(configData) {
dispatch({ type: SAVE_CONFIG_REQUEST });
try {
await sqlectron.config.saveSettings(configData);
await sqlectron.setSelectLimit();
dispatch({ type: SAVE_CONFIG_SUCCESS, config: configData });
} catch (error) {
dispatch({ type: SAVE_CONFIG_FAILURE, error });
Expand Down

0 comments on commit ba1e062

Please sign in to comment.