Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Dec 2, 2024
1 parent f58e600 commit 40ccddc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/functionality/configure/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::PathBuf;

use tauri::path::BaseDirectory;
use tauri::Manager;
use webkit2gtk::{PermissionRequestExt, SettingsExt, WebViewExt, WebContextExt};
use webkit2gtk::{PermissionRequestExt, SettingsExt, WebContextExt, WebViewExt};

use crate::gpu::disable_hardware_accel_linux;
use crate::log;
Expand Down Expand Up @@ -50,4 +50,4 @@ pub fn enable_webrtc(window: &tauri::WebviewWindow) {
});
})
.unwrap_or_else(|_| log!("Failed to enable WebRTC"));
}
}
2 changes: 1 addition & 1 deletion src-tauri/src/functionality/configure/macos.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub fn configure(window: &tauri::WebviewWindow) {
super::menu::create_menubar(window.app_handle()).unwrap_or_default();
}
}
30 changes: 20 additions & 10 deletions src-tauri/src/functionality/configure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ mod linux;
use tauri::Manager;
use tauri_plugin_window_state::{StateFlags, WindowExt};

use crate::{config::get_config, injection::plugin::load_plugins, log, util::{color::start_os_accent_subscriber, window_helpers::{set_user_agent, ultrashow, window_zoom_level}}, window::blur::apply_effect};
use crate::{
config::get_config,
injection::plugin::load_plugins,
log,
util::{
color::start_os_accent_subscriber,
window_helpers::{set_user_agent, ultrashow, window_zoom_level},
},
window::blur::apply_effect,
};

use super::{extension::load_extensions, rpc::start_rpc_server, tray::create_tray};

Expand All @@ -27,14 +36,15 @@ pub fn configure(window: &tauri::WebviewWindow) {
if !config.multi_instance.unwrap_or(false) {
log!("Multi-instance disabled, registering single instance plugin...");

handle.plugin(tauri_plugin_single_instance::init(
move |app, _argv, _cwd| {
if let Some(win) = app.get_webview_window("main") {
ultrashow(win);
}
},
))
.unwrap_or_else(|_| log!("Failed to register single instance plugin"));
handle
.plugin(tauri_plugin_single_instance::init(
move |app, _argv, _cwd| {
if let Some(win) = app.get_webview_window("main") {
ultrashow(win);
}
},
))
.unwrap_or_else(|_| log!("Failed to register single instance plugin"));
}

// If safemode is enabled, stop here
Expand Down Expand Up @@ -99,4 +109,4 @@ pub fn configure(window: &tauri::WebviewWindow) {
linux::configure(window);

window_zoom_level(window.clone(), None);
}
}
3 changes: 1 addition & 2 deletions src-tauri/src/functionality/configure/windows.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use std::fs;
use std::path::PathBuf;
use tauri::path::BaseDirectory;
Expand Down Expand Up @@ -37,4 +36,4 @@ pub fn install_extension(window: &tauri::WebviewWindow) {

// Refresh the page to ensure extensions are loaded
window.eval("window.location.reload();").unwrap_or_default();
}
}
3 changes: 0 additions & 3 deletions src-tauri/src/functionality/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use tauri_plugin_window_state::{AppHandleExt, StateFlags};
use crate::config::get_config;
use crate::log;



// Minimize
#[tauri::command]
pub fn minimize(win: tauri::WebviewWindow) {
Expand Down Expand Up @@ -59,4 +57,3 @@ pub fn setup_autostart(app: &mut tauri::App) {
autostart_manager.is_enabled().unwrap_or_default()
);
}

5 changes: 1 addition & 4 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ use util::{
};

use crate::{
functionality::{
window::setup_autostart,
configure::configure
},
functionality::{configure::configure, window::setup_autostart},
util::logger,
};

Expand Down

0 comments on commit 40ccddc

Please sign in to comment.