Skip to content

Commit

Permalink
modified for portable
Browse files Browse the repository at this point in the history
  • Loading branch information
RoderickQiu committed Jul 30, 2020
1 parent c3fff31 commit 84fd212
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion settings-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ function keyDownTriggerRemover() {
var aes = require("crypto-js/aes");
var encoding = require("crypto-js/enc-utf8");
var copyToClipboard = require("copy-to-clipboard");
var statistics = new Store({ name: 'statistics' });
if (process.env.NODE_ENV == "portable") {
statistics = new Store({ cwd: require("electron").remote.app.getPath('exe').replace("wnr.exe", ""), name: 'wnr-statistics' });
} else {
statistics = new Store({ name: 'statistics' });
}
function settingsBackup(mode) {
var cipherText = aes.encrypt(JSON.stringify((mode == "statistics") ? statistics.store : store.store), (mode == "statistics") ? String("She's awesome.") : String("We all love wnr, so please do not use this passcode to do bad things."));
copyToClipboard(cipherText.toString());
Expand Down

0 comments on commit 84fd212

Please sign in to comment.