Skip to content

Commit

Permalink
Merge pull request #52 from KunalSin9h/issues
Browse files Browse the repository at this point in the history
Issues
  • Loading branch information
KunalSin9h authored Nov 2, 2023
2 parents e593569 + 03fc394 commit a64a453
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 213 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@


# For checking version validity and showing the current version
go run scripts/secops.go version
go run scripts/secops.go version
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"devDependencies": {
"@tauri-apps/cli": "^1.5.6",
"@types/node": "^20.8.10",
"@types/react": "^18.2.33",
"@types/react": "^18.2.34",
"@types/react-dom": "^18.2.14",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@vitejs/plugin-react": "^4.1.0",
"@vitejs/plugin-react": "^4.1.1",
"autoprefixer": "^10.4.16",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
Expand Down Expand Up @@ -58,5 +58,5 @@
"preview": "vite preview",
"tauri": "tauri"
},
"version": "0.13.0"
"version": "0.13.1"
}
376 changes: 188 additions & 188 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ edition = '2021'
license = 'MIT'
name = 'secops'
repository = 'https://github.com/kunalsin9h/secops'
version = '0.13.0'
version = '0.13.1'

[profile]
[profile.ci]
Expand Down
30 changes: 20 additions & 10 deletions src-tauri/src/core/app.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::path::PathBuf;
use std::process::exit;
use std::sync::Mutex;
use tauri::{Manager, Window};

Expand All @@ -10,15 +11,24 @@ pub struct Application {
#[tauri::command]
pub async fn close_loading(window: Window) {
// Close loading splashscreen
window
.get_window("loading")
.expect("no window labeled 'loading' found")
.close()
.unwrap();
match window.get_window("loading") {
Some(frame) => {
if let Err(e) = frame.close() {
log::error!("{}", e);
}
}
None => log::warn!("no window labeled 'loading' found, maybe the app is reloaded"),
};

// Show main window
window
.get_window("main")
.expect("no window labeled 'main' found")
.show()
.unwrap();
match window.get_window("main") {
Some(frame) => {
if let Err(e) = frame.show() {
log::error!("{}", e);
log::info!("Exiting...");
exit(1);
}
}
None => log::warn!("no window labeled 'main' found"),
};
}
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "Secops",
"version": "0.13.0"
"version": "0.13.1"
},
"tauri": {
"allowlist": {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Header/ExportCommit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ function CommitBox({
>
<div
className={`${
status ? "bg-green-100" : "bg-green-200"
status ? "bg-green-100" : "bg-green-300"
} text-black
hover:bg-green-500/50
px-3 py-2 rounded-md `}
>
<span className="text-xs uppercase font-bold">
{status ? "All Good" : "Commit"}
{status ? "All Good" : "Commit..."}
</span>
</div>
</DialogTrigger>
Expand Down Expand Up @@ -174,7 +174,7 @@ function RevertBox({
{states.map((value, index) => (
<div
key={index}
className="flex flex-col gap-4 px-4 xl:px-8 my-4 xl:my-8"
className="flex flex-col gap-2 px-4 xl:px-8 my-4 xl:my-8 border-t pt-2 xl:pt-4"
>
<span className="text-md font-bold">{value.message}</span>
<div className="flex gap-4 items-center">
Expand Down
14 changes: 9 additions & 5 deletions src/components/Header/Import.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Import() {
<div>
<div
className={`h-36 w-full p-4 flex justify-center items-center rounded-xl border border-2 ${
selectedFile ? "border-green-200" : ""
selectedFile ? "border-green-400 border-dashed border-4" : ""
}`}
>
<div className="flex flex-col gap-4 items-center">
Expand Down Expand Up @@ -93,7 +93,9 @@ function Import() {
</div>
<div className="mt-4">
<Button
className={`${processing ? "opacity-60 cursor-wait" : ""}`}
className={`${
processing ? "opacity-60 cursor-wait pointer-events-none" : ""
}`}
variant={"default"}
onClick={async (e) => {
e.preventDefault();
Expand All @@ -102,10 +104,12 @@ function Import() {
toastError(
"Commit the current settings first before applying new settings!",
);
setProcessing(false);
return;
}
if (!selectedFile) {
toastError("No file selected");
setProcessing(false);
return;
}

Expand All @@ -115,13 +119,13 @@ function Import() {
title: "Settings Imported successfully",
desc: "Reload the window to update UI",
});
} catch (err) {
toastError(err);
} catch (e) {
toastError(e);
}
setProcessing(false);
}}
>
{processing ? "Applying" : "Apply"}
{processing ? "Applying..." : "Apply"}
</Button>
</div>
</div>
Expand Down

0 comments on commit a64a453

Please sign in to comment.