Skip to content

Commit

Permalink
fix: multiple window error suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
golota60 committed Mar 3, 2023
1 parent 882f71f commit bae74e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<br>
</div>

| Linux | MacOS | Windows |
| :--------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
| Linux | MacOS | Windows |
| :------------------------------------------------------------------: | :------------------------------------------------------------------: | :----------------------------------------------------------------: |
| ![](https://github.com/golota60/trayasen/blob/master/linux-demo.png) | ![](https://github.com/golota60/trayasen/blob/master/macos-demo.png) | ![](https://github.com/golota60/trayasen/blob/master/win-demo.png) |

<br>
Expand Down Expand Up @@ -82,7 +82,7 @@ To run the app in developer environment, clone the repo, run `yarn` in the root(

## Releasing

The release is automatically triggered upon push to the `release` branch. In order to release, simply create commit that bumps up version in `tauri.conf.json` in master, then a `release` branch that mirrors `master` branch.
The release is automatically triggered upon push to the `release` branch. In order to release, simply create commit that bumps up version in `tauri.conf.json` in master, then a `release` branch that mirrors `master` branch.

## Roadmap, known issues and feature requests

Expand Down Expand Up @@ -112,4 +112,4 @@ Known issues:

- [x] Clicking on newly added element
- [ ] manually stopping a moving desk deadlocks the app
- [ ] opening a new window while the other is already open
- [x] opening a new window while the other is already open
30 changes: 21 additions & 9 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn main() {
std::process::exit(0);
}
config_utils::ABOUT_ID => {
tauri::WindowBuilder::new(
match tauri::WindowBuilder::new(
app,
"main",
tauri::WindowUrl::App("index.html".into()),
Expand All @@ -180,11 +180,15 @@ fn main() {
history.replaceState({}, '','/about');
"#,
)
.build()
.expect("Error while trying to open about window");
.build() {
Ok(_) => {},
Err(_) => {
println!("Error while trying to open about window");
}
}
}
config_utils::ADD_POSITION_ID => {
tauri::WindowBuilder::new(
match tauri::WindowBuilder::new(
app,
"main",
tauri::WindowUrl::App("index.html".into()),
Expand All @@ -195,11 +199,15 @@ fn main() {
history.replaceState({}, '','/new-position');
"#,
)
.build()
.expect("Error while trying to open new postition window");
.build() {
Ok(_) => {},
Err(_) => {
println!("Error while trying to open new postition window");
}
}
}
config_utils::MANAGE_POSITIONS_ID => {
tauri::WindowBuilder::new(
match tauri::WindowBuilder::new(
app,
"main",
tauri::WindowUrl::App("index.html".into()),
Expand All @@ -210,8 +218,12 @@ fn main() {
history.replaceState({}, '','/manage-positions');
"#,
)
.build()
.expect("Error while trying to open manage positions window");
.build() {
Ok(_) => {},
Err(_) => {
println!("Error while trying to open manage positions window");
}
}
}
remaining_id => {
// Check whether a position has been clicked
Expand Down

0 comments on commit bae74e5

Please sign in to comment.