mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
fix: unable to synchronize
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::{conf::ChatConfJson, utils};
|
||||
use crate::{conf::ChatConfJson, utils::{self, exists}};
|
||||
use std::{collections::HashMap, fs, path::PathBuf};
|
||||
use tauri::{api, command, AppHandle, Manager};
|
||||
|
||||
@@ -151,6 +151,13 @@ pub fn sync_prompts(app: AppHandle, data: String, time: u64) {
|
||||
let model_cmd = chat_root().join("chat.model.cmd.json");
|
||||
let chatgpt_prompts = chat_root().join("cache_model").join("chatgpt_prompts.json");
|
||||
|
||||
if !exists(&model) {
|
||||
fs::write(&model, serde_json::json!({
|
||||
"name": "ChatGPT Model",
|
||||
"link": "https://github.com/lencx/ChatGPT"
|
||||
}).to_string()).unwrap();
|
||||
}
|
||||
|
||||
// chatgpt_prompts.json
|
||||
fs::write(
|
||||
chatgpt_prompts,
|
||||
|
||||
Reference in New Issue
Block a user