fix(gui): Button to open data directory (#256)

This commit is contained in:
Mohan 2025-01-22 16:29:11 +01:00 committed by GitHub
parent 9e27c6548b
commit c9d3536f36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 187 additions and 24 deletions

View file

@ -5,9 +5,10 @@ import PromiseInvokeButton from "renderer/components/PromiseInvokeButton";
import { useAppSelector } from "store/hooks";
import InfoBox from "../../modal/swap/InfoBox";
import CliLogsBox from "../../other/RenderedCliLog";
import { initializeContext } from "renderer/rpc";
import { getDataDir, initializeContext } from "renderer/rpc";
import { relaunch } from "@tauri-apps/plugin-process";
import RotateLeftIcon from "@material-ui/icons/RotateLeft";
import { revealItemInDir } from "@tauri-apps/plugin-opener";
const useStyles = makeStyles((theme) => ({
actionsOuter: {
@ -66,11 +67,12 @@ export default function DaemonControlBox() {
<PromiseInvokeButton
endIcon={<FolderOpenIcon />}
isIconButton
requiresContext={false}
size="small"
tooltipTitle="Open the data directory of the Swap Daemon in your file explorer"
onInvoke={() => {
// TODO: Implement this
throw new Error("Not implemented");
tooltipTitle="Open the data directory in your file explorer"
onInvoke={async () => {
const dataDir = await getDataDir();
await revealItemInDir(dataDir);
}}
/>
</Box>