mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
Manually check for updates in 'Control Center'
This commit is contained in:
@@ -43,6 +43,11 @@ pub fn reset_chat_conf() -> ChatConfJson {
|
||||
ChatConfJson::reset_chat_conf()
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub fn run_check_update(app: AppHandle) -> () {
|
||||
utils::run_check_update(app).unwrap();
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub fn form_confirm(_app: AppHandle, data: serde_json::Value) {
|
||||
ChatConfJson::amend(&serde_json::json!(data), None).unwrap();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::borrow::Borrow;
|
||||
use crate::{app::window, conf::ChatConfJson, utils};
|
||||
use log::info;
|
||||
use tauri::{utils::config::WindowUrl, window::WindowBuilder, App, GlobalShortcutManager, Manager, AppHandle, Wry};
|
||||
use tauri::{utils::config::WindowUrl, window::WindowBuilder, App, GlobalShortcutManager, Manager};
|
||||
use wry::application::accelerator::Accelerator;
|
||||
|
||||
pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
@@ -57,6 +57,7 @@ async fn main() {
|
||||
cmd::open_link,
|
||||
cmd::get_chat_conf,
|
||||
cmd::reset_chat_conf,
|
||||
cmd::run_check_update,
|
||||
cmd::form_cancel,
|
||||
cmd::form_confirm,
|
||||
cmd::form_msg,
|
||||
|
||||
9
src/layout/index.tsx
vendored
9
src/layout/index.tsx
vendored
@@ -3,8 +3,7 @@ import {Layout, Menu, Button, Tooltip, message} from 'antd';
|
||||
import { SyncOutlined } from '@ant-design/icons';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import { getName, getVersion } from '@tauri-apps/api/app';
|
||||
import { checkUpdate, installUpdate } from '@tauri-apps/api/updater';
|
||||
import { relaunch } from '@tauri-apps/api/process';
|
||||
import { invoke } from '@tauri-apps/api';
|
||||
|
||||
import Routes, { menuItems } from '@/routes';
|
||||
import './index.scss';
|
||||
@@ -24,11 +23,7 @@ const ChatLayout: FC<ChatLayoutProps> = ({ children }) => {
|
||||
const go = useNavigate();
|
||||
|
||||
const checkAppUpdate = async () => {
|
||||
try {
|
||||
await checkUpdate();
|
||||
}catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
await invoke('run_check_update');
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user