Skip to content

Commit

Permalink
release v22.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
a5huynh committed Aug 10, 2022
2 parents 4f5abd2 + 87277ee commit 42e278a
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<br />
<br />
Download now:
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.8.4/Spyglass_22.8.4_x64.dmg">
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.8.5/Spyglass_22.8.5_x64.dmg">
<strong>macOS</strong>
</a> |
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.8.4/Spyglass_22.8.4_x64_en-US.msi">
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.8.5/Spyglass_22.8.5_x64_en-US.msi">
<strong>Windows</strong>
</a> |
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.8.4/spyglass_22.8.4_amd64.AppImage">
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.8.5/spyglass_22.8.5_amd64.AppImage">
<strong>Linux (AppImage)</strong>
</a>
<br />
Expand Down
20 changes: 10 additions & 10 deletions VERSION.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"version": "22.8.4",
"notes": "Thank you for using Spyglass! See full release notes here: https://github.com/a5huynh/spyglass/releases/tag/v2022.8.4",
"version": "22.8.5",
"notes": "Thank you for using Spyglass! See full release notes here: https://github.com/a5huynh/spyglass/releases/tag/v2022.8.5",
"pub_date": "2022-08-09T17:19:48Z",
"platforms": {
"darwin-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnUxWGlvajA5VVhzdFlmQW5XN0xYZ01lYVpnS3NuRGYvSE1hOUtQR201eEVuaEZzTnFuODhpRUtCYU4weWlzVFVXN2tHblE3UkIwM1NwVVYzSDcra2drPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDY0MTYyCWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negpIeW9OQ1ZaQStETzJaT0J6TFZtVnRNbVkzZklycHYvNHlVRkE0bTZPbGJVVkQvd0xMTkZHclhlcWQ2eDFlZjRvL2ZyNFNvdWlQaFJQRU1jeFp6ejFBUT09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.4/Spyglass.app.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYmtrZE1qTWZ5Z0Y4NldWMUxNQjNSSEd5OENhT3BkUllQWWM1NGE0Y0NLc1EvUmhsWmUwTjlGN1U2QlprL0Ywem9VckpncU96UkdseTFnY1hjT3Z5RndvPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDg3ODU2CWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negpFTG1VbE1UK3ZrdGFqbzhlMG5VZGN5VWFBRlRjR1FMSDFhcHVvMmN0d09NZFhIeTlIbFFsZGpoNmFWZGdqR3JFazJxU2JUaFJpaVVrb3dUNFp3MnNDZz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.5/Spyglass.app.tar.gz"
},
"darwin-aarch64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnUxWGlvajA5VVhzdFlmQW5XN0xYZ01lYVpnS3NuRGYvSE1hOUtQR201eEVuaEZzTnFuODhpRUtCYU4weWlzVFVXN2tHblE3UkIwM1NwVVYzSDcra2drPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDY0MTYyCWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negpIeW9OQ1ZaQStETzJaT0J6TFZtVnRNbVkzZklycHYvNHlVRkE0bTZPbGJVVkQvd0xMTkZHclhlcWQ2eDFlZjRvL2ZyNFNvdWlQaFJQRU1jeFp6ejFBUT09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.4/Spyglass.app.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYmtrZE1qTWZ5Z0Y4NldWMUxNQjNSSEd5OENhT3BkUllQWWM1NGE0Y0NLc1EvUmhsWmUwTjlGN1U2QlprL0Ywem9VckpncU96UkdseTFnY1hjT3Z5RndvPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDg3ODU2CWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negpFTG1VbE1UK3ZrdGFqbzhlMG5VZGN5VWFBRlRjR1FMSDFhcHVvMmN0d09NZFhIeTlIbFFsZGpoNmFWZGdqR3JFazJxU2JUaFJpaVVrb3dUNFp3MnNDZz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.5/Spyglass.app.tar.gz"
},
"linux-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnBBcXVRYXVWTzJ3akp6WEVVZTFoSUFPd1FON0pCQk1GZ2pMQkNrS0loeUdUZkk0UzFIcDVmSERvZS9DMWZ4MTFXc1J2UlVHTTlrKzczai9zZmt3TUFjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDYyMzcxCWZpbGU6c3B5Z2xhc3NfMjIuOC40X2FtZDY0LkFwcEltYWdlLnRhci5negpKSDN0aWRvNWZUN1VLU0dZWnRTZDFWRFZCNmVrOUU2anJZTlF6T1REUThIU3puV0w1NERnemhCWTYyenNuVU5qOHU3SGJXZENPeWhYS00zblFTV2JBZz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.4/spyglass_22.8.4_amd64.AppImage.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYm9wMXQwS0E4WVl2NWpxM3Ria1QzT1hyMitHL3FZbUVjTkJsTXMvQUxPTFN6OE0vZGRhRUZOWElXVXRHWTFoaXU1MG5FNkF5OUswTUFNaS9XK3J4ZkFVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDg2ODkzCWZpbGU6c3B5Z2xhc3NfMjIuOC41X2FtZDY0LkFwcEltYWdlLnRhci5negozc3lGYzBwa3lRc2U3UFhDRjNYUGFxWWhKUVFlekRad013NXZoVUt0NEEySjZPMjVwQjE2YzEzaEhXWkpYdTBtSm1vNWdFRU4xc3NUWGJ6L0NRUE5DQT09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.5/spyglass_22.8.5_amd64.AppImage.tar.gz"
},
"windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYmhxTS9pZmNPcmRJTktCLzA2WDlNTXZTUVBoY2NOQktZQXlKYmlQcXl6ZmVieU1Yb2RPa0YyM2dtbHgzdTUySE9oMDkwZlU3T21EUEZYVktNNFEwN2dRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDYzNjA3CWZpbGU6U3B5Z2xhc3NfMjIuOC40X3g2NF9lbi1VUy5tc2kuemlwCkFHM2xJbWUyTXdDSDdtN3psbjBGWUdSN1ZmNTBtR3hsWTlMckdyZmx2czNZZ1cxckRRUDB5ZUFaSXJPcnc5a1czbUQ1cUNqbmU0OFFLZVJzY1oxV0FBPT0K",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.4/Spyglass_22.8.4_x64_en-US.msi.zip"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnZ0SzVOdmVCWDZ2QnlyNjJLb1dZQ3gvWUw0U1FlTkFOZ3h2a2phMnI5NHQ3NUN6S2JZZnBENUFWOEViSno4Y2d2NVFTbndIanVaakxlU09oNVJVUXd3PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjYwMDg3OTQ0CWZpbGU6U3B5Z2xhc3NfMjIuOC41X3g2NF9lbi1VUy5tc2kuemlwCjFsblo0RUF3U01nMG9wSVIzd25rNW5NSGhiZDllR2ljcW95SmlCRVRoS2VlVzFoRzhBMnIrMHU4VGRiQjUzQjRxTmtxRVZvT1cyZUhXbEorOW1Cb0FnPT0K",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.8.5/Spyglass_22.8.5_x64_en-US.msi.zip"
}
}
}
2 changes: 1 addition & 1 deletion crates/shared/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub trait Rpc {
fn search_lenses(&self, query: SearchLensesParam) -> BoxFuture<Result<SearchLensesResp>>;

#[rpc(name = "toggle_pause")]
fn toggle_pause(&self) -> BoxFuture<Result<AppStatus>>;
fn toggle_pause(&self) -> BoxFuture<Result<bool>>;

#[rpc(name = "toggle_plugin")]
fn toggle_plugin(&self, name: String) -> BoxFuture<Result<()>>;
Expand Down
2 changes: 1 addition & 1 deletion crates/spyglass/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spyglass"
version = "22.8.5"
version = "22.8.6"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/spyglass/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl Rpc for SpyglassRPC {
Box::pin(route::search_lenses(self.state.clone(), query))
}

fn toggle_pause(&self) -> BoxFuture<Result<AppStatus>> {
fn toggle_pause(&self) -> BoxFuture<Result<bool>> {
Box::pin(route::toggle_pause(self.state.clone()))
}

Expand Down
16 changes: 7 additions & 9 deletions crates/spyglass/src/api/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,16 @@ pub async fn search_lenses(
}

#[instrument(skip(state))]
pub async fn toggle_pause(state: AppState) -> jsonrpc_core::Result<AppStatus> {
pub async fn toggle_pause(state: AppState) -> jsonrpc_core::Result<bool> {
// Scope so that the app_state mutex is correctly released.
{
let app_state = &state.app_state;
let mut paused_status = app_state.entry("paused".into()).or_insert("false".into());
let app_state = &state.app_state;
let mut paused_status = app_state.entry("paused".into()).or_insert("false".into());

let current_status = paused_status.to_string() == "true";
let updated_status = !current_status;
*paused_status = updated_status.to_string();
}
let current_status = paused_status.to_string() == "true";
let updated_status = !current_status;
*paused_status = updated_status.to_string();

_get_current_status(state.clone()).await
Ok(updated_status)
}

#[instrument(skip(state))]
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ pub async fn network_change(
if should_toggle {
let _ = rpc
.client
.call_method::<Value, response::AppStatus>("toggle_pause", "", Value::Null)
.call_method::<Value, bool>("toggle_pause", "", Value::Null)
.await;
}
}
Expand Down
33 changes: 19 additions & 14 deletions crates/tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
})
.on_system_tray_event(move |app, event| {
if let SystemTrayEvent::MenuItemClick { id, .. } = event {
let item_handle = app.tray_handle().get_item(&id);
let window = app.get_window("main").expect("Main window not initialized");

if let Ok(menu_id) = MenuID::from_str(&id) {
match menu_id {
MenuID::CRAWL_STATUS => {
let rpc = app.state::<RpcMutex>().inner();
let is_paused = tauri::async_runtime::block_on(pause_crawler(rpc));
let new_label = if is_paused {
"▶️ Resume indexing"
} else {
"⏸ Pause indexing"
};

let _ = item_handle.set_title(new_label);
// Don't block main thread when pausing the crawler.
let item_handle = app.tray_handle().get_item(&id);
let _ = item_handle.set_title("Handling request...");
let _ = item_handle.set_enabled(false);
tauri::async_runtime::spawn(pause_crawler(app.clone(), id.clone()));
}
MenuID::OPEN_LENS_MANAGER => { show_lens_manager_window(app); },
MenuID::OPEN_PLUGIN_MANAGER => { show_plugin_manager(app); },
Expand Down Expand Up @@ -253,18 +248,28 @@ async fn app_status(rpc: &rpc::RpcMutex) -> Option<response::AppStatus> {
}
}

async fn pause_crawler(rpc: &rpc::RpcMutex) -> bool {
async fn pause_crawler(app: AppHandle, menu_id: String) {
let rpc = app.state::<RpcMutex>().inner();
let mut rpc = rpc.lock().await;
match rpc
.client
.call_method::<Value, response::AppStatus>("toggle_pause", "", Value::Null)
.call_method::<Value, bool>("toggle_pause", "", Value::Null)
.await
{
Ok(resp) => resp.is_paused,
Ok(resp) => {
let new_label = if resp {
"▶️ Resume indexing"
} else {
"⏸ Pause indexing"
};

let item_handle = app.tray_handle().get_item(&menu_id);
let _ = item_handle.set_title(new_label);
let _ = item_handle.set_enabled(true);
}
Err(err) => {
log::error!("Error sending RPC: {}", err);
rpc.reconnect().await;
false
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"package": {
"productName": "Spyglass",
"version": "22.8.5"
"version": "22.8.6"
},
"build": {
"distDir": "../client/dist",
Expand Down

0 comments on commit 42e278a

Please sign in to comment.