Skip to content

Commit

Permalink
fix: Change wallet - delete wallet fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
juanky201271 committed Jan 28, 2024
1 parent 8d1b47a commit 5e048ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/loadingscreen/LoadingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ class LoadingScreen extends Component<LoadingScreenProps & RouteComponentProps,
if (native.zingolib_wallet_exists(chain)) {
const result: string = native.zingolib_initialize_existing(url, chain);
console.log(`Initialization: ${result}`);
// interrupt syncing, just in case.
const resultInterrupt: string = await native.zingolib_execute_async("interrupt_sync_after_batch", "true");
console.log("Interrupting sync ...", resultInterrupt);
const resultDelete: string = await native.zingolib_execute_async("delete", "");
console.log("deleting ...", resultDelete);

Expand Down
5 changes: 5 additions & 0 deletions src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ExportPrivKeyModal from "./components/ExportPrivKeyModal";
import SidebarMenuItem from "./components/SidebarMenuItem";
import { ContextApp } from "../../context/ContextAppState";
import { Logo } from "../logo";
import native from "../../native.node";

const { ipcRenderer, remote } = window.require("electron");
const fs = window.require("fs");
Expand Down Expand Up @@ -204,6 +205,10 @@ class Sidebar extends PureComponent<SidebarProps & RouteComponentProps, SidebarS
// Reset the info object, it will be refetched
setInfo(new Info());

// interrupt syncing
const resultInterrupt: string = await native.zingolib_execute_async("interrupt_sync_after_batch", "true");
console.log("Interrupting sync ....", resultInterrupt);

this.props.navigateToLoadingScreen(true, "Change to another wallet...", serverUris)
});

Expand Down

0 comments on commit 5e048ac

Please sign in to comment.