File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use super::{Page, IFEXIT};
55use crossterm:: event:: { self , Event , KeyCode } ;
66use std:: { env, io, process:: Command } ;
77use tui:: widgets:: ListState ;
8+ use serde_json:: json;
89pub ( super ) async fn subscribe_state ( app : & mut AppSub ) -> io:: Result < IFEXIT > {
910 if app. receiver . is_some ( ) {
1011 if let Ok ( get_list) = app. receiver . as_mut ( ) . unwrap ( ) . try_recv ( ) {
@@ -144,12 +145,9 @@ pub(super) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
144145 KeyCode :: Char ( 's' ) => {
145146 utils:: create_json_file (
146147 utils:: Save :: V2ray ,
147- format ! (
148- "{{\n \
149- \" v2core\" :\" {}\" \n \
150- }}",
151- app. settings_input[ 0 ]
152- ) ,
148+ json ! ( {
149+ "v2core" : app. settings_input[ 0 ]
150+ } ) . to_string ( )
153151 )
154152 . unwrap_or_else ( |err| panic ! ( "{}" , err) ) ;
155153 let mut subscribe_json: String = "[\n \n " . to_string ( ) ;
You can’t perform that action at this time.
0 commit comments