mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: optim
This commit is contained in:
@@ -9,7 +9,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
|
||||
let theme = ChatConfJson::theme();
|
||||
let handle = app.app_handle();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
tokio::spawn(async move {
|
||||
window::tray_window(&handle);
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
|
||||
app.set_activation_policy(tauri::ActivationPolicy::Accessory);
|
||||
} else {
|
||||
let app = app.handle();
|
||||
std::thread::spawn(move || {
|
||||
tokio::spawn(async move {
|
||||
#[cfg(target_os = "macos")]
|
||||
WindowBuilder::new(&app, "core", WindowUrl::App(url.into()))
|
||||
.title("ChatGPT")
|
||||
|
||||
@@ -6,7 +6,7 @@ pub fn tray_window(handle: &tauri::AppHandle) {
|
||||
let theme = conf::ChatConfJson::theme();
|
||||
let app = handle.clone();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
tokio::spawn(async move {
|
||||
WindowBuilder::new(&app, "tray", WindowUrl::App(chat_conf.origin.into()))
|
||||
.title("ChatGPT")
|
||||
.resizable(false)
|
||||
@@ -28,7 +28,7 @@ pub fn tray_window(handle: &tauri::AppHandle) {
|
||||
|
||||
pub fn control_window(handle: &tauri::AppHandle) {
|
||||
let app = handle.clone();
|
||||
std::thread::spawn(move || {
|
||||
tokio::spawn(async move {
|
||||
WindowBuilder::new(&app, "main", WindowUrl::App("index.html".into()))
|
||||
.title("ChatGPT")
|
||||
.resizable(true)
|
||||
|
||||
@@ -15,7 +15,8 @@ use tauri_plugin_log::{
|
||||
LogTarget, LoggerBuilder,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
ChatConfJson::init();
|
||||
// If the file does not exist, creating the file will block menu synchronization
|
||||
utils::create_chatgpt_prompts();
|
||||
|
||||
Reference in New Issue
Block a user