| 
									
										
										
										
											2022-01-08 18:21:13 +08:00
										 |  |  | use crate::prelude::*;
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  | use flowy_folder::entities::WorkspaceIdPB;
 | 
					
						
							| 
									
										
										
										
											2022-01-27 20:39:54 +08:00
										 |  |  | use flowy_folder::{
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |     entities::{
 | 
					
						
							|  |  |  |         app::*,
 | 
					
						
							|  |  |  |         view::*,
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  |         workspace::{CreateWorkspacePayloadPB, WorkspacePB},
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |     },
 | 
					
						
							| 
									
										
										
										
											2022-01-30 10:33:21 +08:00
										 |  |  |     event_map::FolderEvent::{CreateWorkspace, OpenWorkspace, *},
 | 
					
						
							| 
									
										
										
										
											2021-12-06 14:41:09 +08:00
										 |  |  | };
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  | use flowy_user::{
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  |     entities::{SignInPayloadPB, SignUpPayloadPB, UserProfilePB},
 | 
					
						
							| 
									
										
										
										
											2021-12-14 18:04:51 +08:00
										 |  |  |     errors::FlowyError,
 | 
					
						
							| 
									
										
										
										
											2022-01-28 10:56:55 +08:00
										 |  |  |     event_map::UserEvent::{InitUser, SignIn, SignOut, SignUp},
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  | };
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  | use lib_dispatch::prelude::{EventDispatcher, ModuleRequest, ToBytes};
 | 
					
						
							| 
									
										
										
										
											2022-01-08 18:21:13 +08:00
										 |  |  | use std::{fs, path::PathBuf, sync::Arc};
 | 
					
						
							| 
									
										
										
										
											2021-07-16 23:18:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  | pub struct ViewTest {
 | 
					
						
							|  |  |  |     pub sdk: FlowySDKTest,
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  |     pub workspace: WorkspacePB,
 | 
					
						
							|  |  |  |     pub app: AppPB,
 | 
					
						
							|  |  |  |     pub view: ViewPB,
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | impl ViewTest {
 | 
					
						
							| 
									
										
										
										
											2022-03-12 21:06:15 +08:00
										 |  |  |     #[allow(dead_code)]
 | 
					
						
							| 
									
										
										
										
											2022-10-22 21:57:44 +08:00
										 |  |  |     pub async fn new(
 | 
					
						
							|  |  |  |         sdk: &FlowySDKTest,
 | 
					
						
							|  |  |  |         data_format: ViewDataFormatPB,
 | 
					
						
							|  |  |  |         layout: ViewLayoutTypePB,
 | 
					
						
							|  |  |  |         data: Vec<u8>,
 | 
					
						
							|  |  |  |     ) -> Self {
 | 
					
						
							| 
									
										
										
										
											2022-01-23 12:14:00 +08:00
										 |  |  |         let workspace = create_workspace(sdk, "Workspace", "").await;
 | 
					
						
							|  |  |  |         open_workspace(sdk, &workspace.id).await;
 | 
					
						
							|  |  |  |         let app = create_app(sdk, "App", "AppFlowy GitHub Project", &workspace.id).await;
 | 
					
						
							| 
									
										
										
										
											2022-10-22 21:57:44 +08:00
										 |  |  |         let view = create_view(sdk, &app.id, data_format, layout, data).await;
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         Self {
 | 
					
						
							|  |  |  |             sdk: sdk.clone(),
 | 
					
						
							|  |  |  |             workspace,
 | 
					
						
							|  |  |  |             app,
 | 
					
						
							|  |  |  |             view,
 | 
					
						
							|  |  |  |         }
 | 
					
						
							|  |  |  |     }
 | 
					
						
							| 
									
										
										
										
											2022-03-12 21:06:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-15 19:00:28 +08:00
										 |  |  |     pub async fn new_grid_view(sdk: &FlowySDKTest, data: Vec<u8>) -> Self {
 | 
					
						
							| 
									
										
										
										
											2022-10-22 21:57:44 +08:00
										 |  |  |         Self::new(sdk, ViewDataFormatPB::DatabaseFormat, ViewLayoutTypePB::Grid, data).await
 | 
					
						
							| 
									
										
										
										
											2022-08-18 17:40:23 +08:00
										 |  |  |     }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     pub async fn new_board_view(sdk: &FlowySDKTest, data: Vec<u8>) -> Self {
 | 
					
						
							| 
									
										
										
										
											2022-10-22 21:57:44 +08:00
										 |  |  |         Self::new(sdk, ViewDataFormatPB::DatabaseFormat, ViewLayoutTypePB::Board, data).await
 | 
					
						
							| 
									
										
										
										
											2022-03-12 21:06:15 +08:00
										 |  |  |     }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-20 11:35:11 +08:00
										 |  |  |     pub async fn new_document_view(sdk: &FlowySDKTest) -> Self {
 | 
					
						
							| 
									
										
										
										
											2022-10-22 21:57:44 +08:00
										 |  |  |         let view_data_format = match sdk.document_version() {
 | 
					
						
							|  |  |  |             DocumentVersionPB::V0 => ViewDataFormatPB::DeltaFormat,
 | 
					
						
							|  |  |  |             DocumentVersionPB::V1 => ViewDataFormatPB::TreeFormat,
 | 
					
						
							|  |  |  |         };
 | 
					
						
							|  |  |  |         Self::new(sdk, view_data_format, ViewLayoutTypePB::Document, vec![]).await
 | 
					
						
							| 
									
										
										
										
											2022-03-12 21:06:15 +08:00
										 |  |  |     }
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  | async fn create_workspace(sdk: &FlowySDKTest, name: &str, desc: &str) -> WorkspacePB {
 | 
					
						
							|  |  |  |     let request = CreateWorkspacePayloadPB {
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         name: name.to_owned(),
 | 
					
						
							|  |  |  |         desc: desc.to_owned(),
 | 
					
						
							|  |  |  |     };
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-22 18:48:43 +08:00
										 |  |  |     let workspace = FolderEventBuilder::new(sdk.clone())
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         .event(CreateWorkspace)
 | 
					
						
							| 
									
										
										
										
											2022-02-24 21:49:18 +08:00
										 |  |  |         .payload(request)
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         .async_send()
 | 
					
						
							|  |  |  |         .await
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  |         .parse::<WorkspacePB>();
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |     workspace
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | async fn open_workspace(sdk: &FlowySDKTest, workspace_id: &str) {
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  |     let payload = WorkspaceIdPB {
 | 
					
						
							| 
									
										
										
										
											2022-02-24 21:49:18 +08:00
										 |  |  |         value: Some(workspace_id.to_owned()),
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |     };
 | 
					
						
							| 
									
										
										
										
											2022-01-22 18:48:43 +08:00
										 |  |  |     let _ = FolderEventBuilder::new(sdk.clone())
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         .event(OpenWorkspace)
 | 
					
						
							| 
									
										
										
										
											2022-02-24 21:49:18 +08:00
										 |  |  |         .payload(payload)
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         .async_send()
 | 
					
						
							|  |  |  |         .await;
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  | async fn create_app(sdk: &FlowySDKTest, name: &str, desc: &str, workspace_id: &str) -> AppPB {
 | 
					
						
							|  |  |  |     let create_app_request = CreateAppPayloadPB {
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         workspace_id: workspace_id.to_owned(),
 | 
					
						
							|  |  |  |         name: name.to_string(),
 | 
					
						
							|  |  |  |         desc: desc.to_string(),
 | 
					
						
							|  |  |  |         color_style: Default::default(),
 | 
					
						
							|  |  |  |     };
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-22 18:48:43 +08:00
										 |  |  |     let app = FolderEventBuilder::new(sdk.clone())
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         .event(CreateApp)
 | 
					
						
							| 
									
										
										
										
											2022-02-24 21:49:18 +08:00
										 |  |  |         .payload(create_app_request)
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         .async_send()
 | 
					
						
							|  |  |  |         .await
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  |         .parse::<AppPB>();
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |     app
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-18 17:40:23 +08:00
										 |  |  | async fn create_view(
 | 
					
						
							|  |  |  |     sdk: &FlowySDKTest,
 | 
					
						
							|  |  |  |     app_id: &str,
 | 
					
						
							| 
									
										
										
										
											2022-10-22 21:57:44 +08:00
										 |  |  |     data_format: ViewDataFormatPB,
 | 
					
						
							| 
									
										
										
										
											2022-08-18 19:32:08 +08:00
										 |  |  |     layout: ViewLayoutTypePB,
 | 
					
						
							| 
									
										
										
										
											2022-08-18 17:40:23 +08:00
										 |  |  |     data: Vec<u8>,
 | 
					
						
							|  |  |  | ) -> ViewPB {
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  |     let request = CreateViewPayloadPB {
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         belong_to_id: app_id.to_string(),
 | 
					
						
							|  |  |  |         name: "View A".to_string(),
 | 
					
						
							|  |  |  |         desc: "".to_string(),
 | 
					
						
							|  |  |  |         thumbnail: Some("http://1.png".to_string()),
 | 
					
						
							| 
									
										
										
										
											2022-10-22 21:57:44 +08:00
										 |  |  |         data_format,
 | 
					
						
							| 
									
										
										
										
											2022-08-18 19:32:08 +08:00
										 |  |  |         layout,
 | 
					
						
							| 
									
										
										
										
											2022-08-18 17:40:23 +08:00
										 |  |  |         view_content_data: data,
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |     };
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-22 18:48:43 +08:00
										 |  |  |     let view = FolderEventBuilder::new(sdk.clone())
 | 
					
						
							|  |  |  |         .event(CreateView)
 | 
					
						
							| 
									
										
										
										
											2022-02-24 21:49:18 +08:00
										 |  |  |         .payload(request)
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  |         .async_send()
 | 
					
						
							|  |  |  |         .await
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:11:29 +08:00
										 |  |  |         .parse::<ViewPB>();
 | 
					
						
							| 
									
										
										
										
											2022-01-22 18:48:43 +08:00
										 |  |  |     view
 | 
					
						
							| 
									
										
										
										
											2021-12-08 17:33:22 +08:00
										 |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 23:18:12 +08:00
										 |  |  | pub fn root_dir() -> String {
 | 
					
						
							|  |  |  |     // https://doc.rust-lang.org/cargo/reference/environment-variables.html
 | 
					
						
							| 
									
										
										
										
											2021-11-27 19:19:41 +08:00
										 |  |  |     let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| "./".to_owned());
 | 
					
						
							| 
									
										
										
										
											2021-07-16 23:18:12 +08:00
										 |  |  |     let mut path_buf = fs::canonicalize(&PathBuf::from(&manifest_dir)).unwrap();
 | 
					
						
							|  |  |  |     path_buf.pop(); // rust-lib
 | 
					
						
							|  |  |  |     path_buf.push("temp");
 | 
					
						
							|  |  |  |     path_buf.push("flowy");
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     let root_dir = path_buf.to_str().unwrap().to_string();
 | 
					
						
							|  |  |  |     if !std::path::Path::new(&root_dir).exists() {
 | 
					
						
							|  |  |  |         std::fs::create_dir_all(&root_dir).unwrap();
 | 
					
						
							|  |  |  |     }
 | 
					
						
							|  |  |  |     root_dir
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-23 12:14:00 +08:00
										 |  |  | pub fn random_email() -> String {
 | 
					
						
							| 
									
										
										
										
											2022-06-13 20:59:46 +08:00
										 |  |  |     format!("{}@appflowy.io", nanoid!(20))
 | 
					
						
							| 
									
										
										
										
											2022-01-23 12:14:00 +08:00
										 |  |  | }
 | 
					
						
							| 
									
										
										
										
											2021-07-16 23:18:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-23 12:14:00 +08:00
										 |  |  | pub fn login_email() -> String {
 | 
					
						
							|  |  |  |     "annie2@appflowy.io".to_string()
 | 
					
						
							|  |  |  | }
 | 
					
						
							| 
									
										
										
										
											2021-07-17 10:26:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-23 12:14:00 +08:00
										 |  |  | pub fn login_password() -> String {
 | 
					
						
							|  |  |  |     "HelloWorld!123".to_string()
 | 
					
						
							|  |  |  | }
 | 
					
						
							| 
									
										
										
										
											2021-08-29 22:00:42 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  | pub struct SignUpContext {
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  |     pub user_profile: UserProfilePB,
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  |     pub password: String,
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-04 11:26:17 +08:00
										 |  |  | pub fn sign_up(dispatch: Arc<EventDispatcher>) -> SignUpContext {
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  |     let password = login_password();
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  |     let payload = SignUpPayloadPB {
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  |         email: random_email(),
 | 
					
						
							|  |  |  |         name: "app flowy".to_string(),
 | 
					
						
							|  |  |  |         password: password.clone(),
 | 
					
						
							|  |  |  |     }
 | 
					
						
							|  |  |  |     .into_bytes()
 | 
					
						
							|  |  |  |     .unwrap();
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     let request = ModuleRequest::new(SignUp).payload(payload);
 | 
					
						
							| 
									
										
										
										
											2021-12-04 11:26:17 +08:00
										 |  |  |     let user_profile = EventDispatcher::sync_send(dispatch, request)
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  |         .parse::<UserProfilePB, FlowyError>()
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  |         .unwrap()
 | 
					
						
							|  |  |  |         .unwrap();
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-28 15:29:29 +08:00
										 |  |  |     SignUpContext { user_profile, password }
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-04 11:26:17 +08:00
										 |  |  | pub async fn async_sign_up(dispatch: Arc<EventDispatcher>) -> SignUpContext {
 | 
					
						
							| 
									
										
										
										
											2021-09-28 15:29:29 +08:00
										 |  |  |     let password = login_password();
 | 
					
						
							| 
									
										
										
										
											2022-06-13 20:59:46 +08:00
										 |  |  |     let email = random_email();
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  |     let payload = SignUpPayloadPB {
 | 
					
						
							| 
									
										
										
										
											2022-06-13 20:59:46 +08:00
										 |  |  |         email,
 | 
					
						
							| 
									
										
										
										
											2021-09-28 15:29:29 +08:00
										 |  |  |         name: "app flowy".to_string(),
 | 
					
						
							|  |  |  |         password: password.clone(),
 | 
					
						
							|  |  |  |     }
 | 
					
						
							|  |  |  |     .into_bytes()
 | 
					
						
							|  |  |  |     .unwrap();
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     let request = ModuleRequest::new(SignUp).payload(payload);
 | 
					
						
							| 
									
										
										
										
											2021-12-04 11:26:17 +08:00
										 |  |  |     let user_profile = EventDispatcher::async_send(dispatch.clone(), request)
 | 
					
						
							| 
									
										
										
										
											2021-09-28 15:29:29 +08:00
										 |  |  |         .await
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  |         .parse::<UserProfilePB, FlowyError>()
 | 
					
						
							| 
									
										
										
										
											2021-09-28 15:29:29 +08:00
										 |  |  |         .unwrap()
 | 
					
						
							|  |  |  |         .unwrap();
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-11 14:26:30 +08:00
										 |  |  |     // let _ = create_default_workspace_if_need(dispatch.clone(), &user_profile.id);
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:53:58 +08:00
										 |  |  |     SignUpContext { user_profile, password }
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-12 12:41:16 +08:00
										 |  |  | pub async fn init_user_setting(dispatch: Arc<EventDispatcher>) {
 | 
					
						
							|  |  |  |     let request = ModuleRequest::new(InitUser);
 | 
					
						
							|  |  |  |     let _ = EventDispatcher::async_send(dispatch.clone(), request).await;
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  | #[allow(dead_code)]
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  | fn sign_in(dispatch: Arc<EventDispatcher>) -> UserProfilePB {
 | 
					
						
							|  |  |  |     let payload = SignInPayloadPB {
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  |         email: login_email(),
 | 
					
						
							|  |  |  |         password: login_password(),
 | 
					
						
							| 
									
										
										
										
											2021-11-07 16:58:06 +08:00
										 |  |  |         name: "rust".to_owned(),
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  |     }
 | 
					
						
							|  |  |  |     .into_bytes()
 | 
					
						
							|  |  |  |     .unwrap();
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     let request = ModuleRequest::new(SignIn).payload(payload);
 | 
					
						
							| 
									
										
										
										
											2021-12-04 11:26:17 +08:00
										 |  |  |     EventDispatcher::sync_send(dispatch, request)
 | 
					
						
							| 
									
										
										
										
											2022-07-19 14:40:56 +08:00
										 |  |  |         .parse::<UserProfilePB, FlowyError>()
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  |         .unwrap()
 | 
					
						
							| 
									
										
										
										
											2021-11-27 19:19:41 +08:00
										 |  |  |         .unwrap()
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:12:48 +08:00
										 |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #[allow(dead_code)]
 | 
					
						
							| 
									
										
										
										
											2022-01-23 12:14:00 +08:00
										 |  |  | fn logout(dispatch: Arc<EventDispatcher>) {
 | 
					
						
							|  |  |  |     let _ = EventDispatcher::sync_send(dispatch, ModuleRequest::new(SignOut));
 | 
					
						
							|  |  |  | }
 |