-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SP-1988 Remove results watcher, do not reload the app after sca…
…n is completed, better error handling
- Loading branch information
1 parent
88dd1d9
commit c9f7ce3
Showing
12 changed files
with
101 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { create } from 'zustand'; | ||
import { devtools } from 'zustand/middleware'; | ||
|
||
import { | ||
GetResultFilePath, | ||
GetScanRoot, | ||
GetScanSettingsFilePath, | ||
SetResultFilePath, | ||
SetScanRoot, | ||
SetScanSettingsFilePath, | ||
} from '../../wailsjs/go/main/App'; | ||
|
||
interface ResultsState { | ||
scanRoot: string; | ||
resultsFile: string; | ||
settingsFile: string; | ||
} | ||
|
||
interface ResultsActions { | ||
setScanRoot: (scanRoot: string) => Promise<void>; | ||
setResultsFile: (resultsFile: string) => Promise<void>; | ||
setSettingsFile: (settingsFile: string) => Promise<void>; | ||
|
||
getInitialConfig: () => Promise<void>; | ||
} | ||
|
||
type ConfigStore = ResultsState & ResultsActions; | ||
|
||
export default create<ConfigStore>()( | ||
devtools((set) => ({ | ||
scanRoot: '', | ||
resultsFile: '', | ||
settingsFile: '', | ||
|
||
setScanRoot: async (scanRoot: string) => { | ||
await SetScanRoot(scanRoot); | ||
set({ scanRoot }); | ||
}, | ||
setResultsFile: async (resultsFile: string) => { | ||
await SetResultFilePath(resultsFile); | ||
console.log(resultsFile); | ||
set({ resultsFile }); | ||
}, | ||
setSettingsFile: async (settingsFile: string) => { | ||
await SetScanSettingsFilePath(settingsFile); | ||
set({ settingsFile }); | ||
}, | ||
|
||
getInitialConfig: async () => { | ||
const scanRoot = await GetScanRoot(); | ||
const resultsFile = await GetResultFilePath(); | ||
const settingsFile = await GetScanSettingsFilePath(); | ||
set({ scanRoot, resultsFile, settingsFile }); | ||
}, | ||
})) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters