|
|
|
@ -405,22 +405,20 @@ export class Stronghold {
|
|
|
|
|
* @param path
|
|
|
|
|
* @param password
|
|
|
|
|
*/
|
|
|
|
|
static async init(path: string, password: string): Promise<Stronghold> {
|
|
|
|
|
let stronghold = new Stronghold(path);
|
|
|
|
|
await stronghold.reload(password);
|
|
|
|
|
return stronghold;
|
|
|
|
|
private constructor(path: string) {
|
|
|
|
|
this.path = path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Force a reload of the snapshot. The password must match.
|
|
|
|
|
* Load the snapshot if it exists (password must match), or start a fresh stronghold instance otherwise.
|
|
|
|
|
* @param password
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
private async reload(password: string): Promise<void> {
|
|
|
|
|
static async load(path: string, password: string): Promise<Stronghold> {
|
|
|
|
|
return await invoke("plugin:stronghold|initialize", {
|
|
|
|
|
snapshotPath: this.path,
|
|
|
|
|
snapshotPath: path,
|
|
|
|
|
password,
|
|
|
|
|
});
|
|
|
|
|
}).then(() => new Stronghold(path));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|