feat: change default singleton port and support to change the port

This commit is contained in:
GyDi
2022-09-06 00:45:01 +08:00
parent 9e7c7ac163
commit c058c29755
4 changed files with 36 additions and 24 deletions

View File

@@ -3,9 +3,6 @@ use tauri::{App, AppHandle, Manager};
/// handle something when start app
pub fn resolve_setup(app: &App) {
// setup a simple http server for singleton
server::embed_server(&app.handle());
// init app config
init::init_app(app.package_info());
@@ -13,6 +10,14 @@ pub fn resolve_setup(app: &App) {
// should be initialized after init_app fix #122
let core = Core::new();
{
let verge = core.verge.lock();
let singleton = verge.app_singleton_port.clone();
// setup a simple http server for singleton
server::embed_server(&app.handle(), singleton);
}
core.set_win(app.get_window("main"));
core.init(app.app_handle());