Skip to content

Commit

Permalink
release-app 🎅 CHRISMAS TIME 🎅
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Dec 24, 2024
1 parent 798299f commit 4e881d3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 36 deletions.
6 changes: 1 addition & 5 deletions screenpipe-app-tauri/lib/hooks/use-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ function createDefaultSettingsObject(): Settings {

return defaultSettings;
} catch (e) {
console.error("failed to get platform", e);
return DEFAULT_SETTINGS;
}
}
Expand Down Expand Up @@ -311,16 +310,13 @@ export function useSettings() {
let p = "macos";
try {
p = platform();
} catch (e) {
console.error("failed to get platform", e);
}
} catch (e) {}

return p === "macos" || p === "linux"
? `${homeDirPath}/.screenpipe`
: `${homeDirPath}\\.screenpipe`;
};


return {
settings,
updateSettings: setSettings,
Expand Down
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
version = "0.21.5"
version = "0.21.6"
description = ""
authors = ["you"]
license = ""
Expand Down
24 changes: 3 additions & 21 deletions screenpipe-app-tauri/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub use permissions::open_permission_settings;
pub use permissions::request_permission;

use tauri::AppHandle;
use tauri_plugin_deep_link::DeepLinkExt;
use tauri_plugin_global_shortcut::GlobalShortcutExt;
use tauri_plugin_global_shortcut::{Code, Modifiers, Shortcut};
pub struct SidecarState(Arc<tokio::sync::Mutex<Option<SidecarManager>>>);
Expand Down Expand Up @@ -553,6 +552,9 @@ async fn main() {
.build()?;
let _ = main_tray.set_menu(Some(menu));

let update_item = update_manager.update_now_menu_item_ref().clone();
tray::setup_tray_menu_updater(app.handle().clone(), &update_item);

main_tray.on_menu_event(move |app_handle, event| match event.id().as_ref() {
"show" => {
show_main_window(app_handle, false);
Expand Down Expand Up @@ -818,33 +820,13 @@ async fn main() {
}
});
}

<<<<<<< HEAD
=======
#[cfg(any(target_os = "linux", all(debug_assertions, windows)))]
app.deep_link().register_all()?;

app.deep_link().on_open_url(move |event| {
let urls: Vec<_> = event.urls().into_iter().collect();
info!("deep link URLs: {:?}", urls);
});
// Register URL scheme on Windows/Linux
#[cfg(any(windows, target_os = "linux"))]
{
if let Err(err) = app.handle().deep_link().register("screenpipe") {
error!("Failed to register deep link protocol: {}", err);
}
}

// Initialize global shortcuts
let app_handle = app.handle().clone();
tauri::async_runtime::spawn(async move {
if let Err(e) = initialize_global_shortcuts(&app_handle).await {
error!("Failed to initialize global shortcuts: {}", e);
}
});

>>>>>>> 7da94cbf3cd799baef60e49976f63cf5a5a91b47
Ok(())
})
.build(tauri::generate_context!())
Expand Down
13 changes: 5 additions & 8 deletions screenpipe-app-tauri/src-tauri/src/sidecar.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{get_base_dir, SidecarState};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::env;
use std::sync::Arc;
use std::time::{Duration, Instant};
use tauri::async_runtime::JoinHandle;
Expand Down Expand Up @@ -367,15 +366,13 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {

args.push("--debug");

// Add exe directory path before the Windows-specific block
let exe_dir = env::current_exe()
.expect("Failed to get current executable path")
.parent()
.expect("Failed to get parent directory of executable")
.to_path_buf();

if cfg!(windows) {

if cfg!(windows) {
let mut c = app
.shell()
.sidecar("screenpipe")
.unwrap();
if use_chinese_mirror {
c = c.env("HF_ENDPOINT", "https://hf-mirror.com");
}
Expand Down
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/src-tauri/src/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tauri::{
menu::{IsMenuItem, MenuBuilder, MenuItemBuilder, PredefinedMenuItem},
AppHandle, Wry,
};
use tracing::{info, debug};
use tracing::debug;

pub async fn update_tray_menu(
app: &AppHandle,
Expand Down

0 comments on commit 4e881d3

Please sign in to comment.