chore: reload workspace when fail to load at the first time (#4633)

* chore: reload workspace when fail to load at the first time

* fix: clippy

* chore: update client api

* chore: fix wasm build

* chore: fix test
This commit is contained in:
Nathan.fooo
2024-02-08 23:53:05 +08:00
committed by GitHub
parent 747fe40648
commit 3b51a6e6be
26 changed files with 468 additions and 197 deletions

View File

@ -24,23 +24,14 @@ pub enum ErrorCode {
#[error("Workspace name can not be empty or whitespace")]
WorkspaceNameInvalid = 5,
#[error("Workspace id can not be empty or whitespace")]
WorkspaceIdInvalid = 6,
#[error("Color style of the App is invalid")]
AppColorStyleInvalid = 7,
#[error("Workspace desc is invalid")]
WorkspaceDescTooLong = 8,
#[error("Workspace description too long")]
WorkspaceNameTooLong = 9,
#[error("App id can not be empty or whitespace")]
AppIdInvalid = 10,
#[error("App name can not be empty or whitespace")]
AppNameInvalid = 11,
#[error("Can't load the workspace data")]
WorkspaceInitializeError = 6,
#[error("View name can not be empty or whitespace")]
ViewNameInvalid = 12,
@ -51,9 +42,6 @@ pub enum ErrorCode {
#[error("View id can not be empty or whitespace")]
ViewIdIsInvalid = 14,
#[error("View desc too long")]
ViewDescTooLong = 15,
#[error("View data is invalid")]
ViewDataInvalid = 16,

View File

@ -70,16 +70,10 @@ impl FlowyError {
static_flowy_error!(internal, ErrorCode::Internal);
static_flowy_error!(record_not_found, ErrorCode::RecordNotFound);
static_flowy_error!(workspace_name, ErrorCode::WorkspaceNameInvalid);
static_flowy_error!(workspace_id, ErrorCode::WorkspaceIdInvalid);
static_flowy_error!(color_style, ErrorCode::AppColorStyleInvalid);
static_flowy_error!(workspace_desc, ErrorCode::WorkspaceDescTooLong);
static_flowy_error!(app_name, ErrorCode::AppNameInvalid);
static_flowy_error!(invalid_app_id, ErrorCode::AppIdInvalid);
static_flowy_error!(workspace_initialize, ErrorCode::WorkspaceInitializeError);
static_flowy_error!(view_name, ErrorCode::ViewNameInvalid);
static_flowy_error!(view_thumbnail, ErrorCode::ViewThumbnailInvalid);
static_flowy_error!(invalid_view_id, ErrorCode::ViewIdIsInvalid);
static_flowy_error!(view_desc, ErrorCode::ViewDescTooLong);
static_flowy_error!(view_data, ErrorCode::ViewDataInvalid);
static_flowy_error!(unauthorized, ErrorCode::UserUnauthorized);
static_flowy_error!(email_empty, ErrorCode::EmailIsEmpty);