mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
use remote.app if app is not defined (#1785)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
ed036d1f99
commit
be3aa88fd4
@ -1,6 +1,6 @@
|
||||
import { randomBytes } from "crypto";
|
||||
import { SHA256 } from "crypto-js";
|
||||
import { app } from "electron";
|
||||
import { app, remote } from "electron";
|
||||
import fse from "fs-extra";
|
||||
import { action, observable, toJS } from "mobx";
|
||||
import path from "path";
|
||||
@ -31,7 +31,7 @@ export class FilesystemProvisionerStore extends BaseStore<FSProvisionModel> {
|
||||
if (!this.registeredExtensions.has(extensionName)) {
|
||||
const salt = randomBytes(32).toString("hex");
|
||||
const hashedName = SHA256(`${extensionName}/${salt}`).toString();
|
||||
const dirPath = path.resolve(app.getPath("userData"), "extension_data", hashedName);
|
||||
const dirPath = path.resolve((app || remote.app).getPath("userData"), "extension_data", hashedName);
|
||||
|
||||
this.registeredExtensions.set(extensionName, dirPath);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user