1
0
mirror of https://github.com/lencx/ChatGPT.git synced 2024-10-01 01:06:13 -04:00

chore: fmt

This commit is contained in:
lencx 2023-01-21 22:51:16 +08:00
parent 5b6a69444e
commit 1e5ec6028d
3 changed files with 36 additions and 36 deletions

View File

@ -299,8 +299,8 @@ pub async fn sync_prompts(app: AppHandle, time: u64) -> Option<Vec<ModelRecord>>
fs::write( fs::write(
&model, &model,
serde_json::json!({ serde_json::json!({
"name": "ChatGPT Model", "name": "ChatGPT Model",
"link": "https://github.com/lencx/ChatGPT" "link": "https://github.com/lencx/ChatGPT"
}) })
.to_string(), .to_string(),
) )
@ -319,9 +319,9 @@ pub async fn sync_prompts(app: AppHandle, time: u64) -> Option<Vec<ModelRecord>>
fs::write( fs::write(
model_cmd, model_cmd,
serde_json::to_string_pretty(&serde_json::json!({ serde_json::to_string_pretty(&serde_json::json!({
"name": "ChatGPT CMD", "name": "ChatGPT CMD",
"last_updated": time, "last_updated": time,
"data": cmd_data, "data": cmd_data,
})) }))
.unwrap(), .unwrap(),
) )

View File

@ -348,18 +348,18 @@ pub fn menu_handler(event: WindowMenuEvent<tauri::Wry>) {
"scroll_top" => win "scroll_top" => win
.eval( .eval(
r#"window.scroll({ r#"window.scroll({
top: 0, top: 0,
left: 0, left: 0,
behavior: "smooth" behavior: "smooth"
})"#, })"#,
) )
.unwrap(), .unwrap(),
"scroll_bottom" => win "scroll_bottom" => win
.eval( .eval(
r#"window.scroll({ r#"window.scroll({
top: document.body.scrollHeight, top: document.body.scrollHeight,
left: 0, left: 0,
behavior: "smooth"})"#, behavior: "smooth"})"#,
) )
.unwrap(), .unwrap(),
// Help // Help

View File

@ -18,32 +18,32 @@ pub const BUY_COFFEE: &str = "https://www.buymeacoffee.com/lencx";
pub const GITHUB_PROMPTS_CSV_URL: &str = pub const GITHUB_PROMPTS_CSV_URL: &str =
"https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv"; "https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv";
pub const DEFAULT_CHAT_CONF: &str = r#"{ pub const DEFAULT_CHAT_CONF: &str = r#"{
"stay_on_top": false, "stay_on_top": false,
"auto_update": "Prompt", "auto_update": "Prompt",
"theme": "Light", "theme": "Light",
"tray": true, "tray": true,
"titlebar": true, "titlebar": true,
"popup_search": false, "popup_search": false,
"global_shortcut": "", "global_shortcut": "",
"hide_dock_icon": false, "hide_dock_icon": false,
"default_origin": "https://chat.openai.com", "default_origin": "https://chat.openai.com",
"origin": "https://chat.openai.com", "origin": "https://chat.openai.com",
"ua_window": "", "ua_window": "",
"ua_tray": "" "ua_tray": ""
}"#; }"#;
pub const DEFAULT_CHAT_CONF_MAC: &str = r#"{ pub const DEFAULT_CHAT_CONF_MAC: &str = r#"{
"stay_on_top": false, "stay_on_top": false,
"auto_update": "Prompt", "auto_update": "Prompt",
"theme": "Light", "theme": "Light",
"tray": true, "tray": true,
"titlebar": false, "titlebar": false,
"popup_search": false, "popup_search": false,
"global_shortcut": "", "global_shortcut": "",
"hide_dock_icon": false, "hide_dock_icon": false,
"default_origin": "https://chat.openai.com", "default_origin": "https://chat.openai.com",
"origin": "https://chat.openai.com", "origin": "https://chat.openai.com",
"ua_window": "", "ua_window": "",
"ua_tray": "" "ua_tray": ""
}"#; }"#;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]