mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-11-01 10:33:29 +00:00
chore: show import error (#6569)
This commit is contained in:
parent
5f0cc1becd
commit
d91639172a
@ -15,7 +15,7 @@ class NotionImporter extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(minHeight: 40, maxHeight: 200),
|
||||
constraints: const BoxConstraints(minHeight: 30, maxHeight: 200),
|
||||
child: FutureBuilder(
|
||||
future: _uploadFile(),
|
||||
builder: (context, snapshots) {
|
||||
@ -23,11 +23,15 @@ class NotionImporter extends StatelessWidget {
|
||||
return const _Uploading();
|
||||
}
|
||||
|
||||
if (snapshots.hasError) {
|
||||
return _UploadError(error: snapshots.error as FlowyError);
|
||||
final result = snapshots.data;
|
||||
if (result == null) {
|
||||
return const _UploadSuccess();
|
||||
} else {
|
||||
return result.fold(
|
||||
(_) => const _UploadSuccess(),
|
||||
(err) => _UploadError(error: err),
|
||||
);
|
||||
}
|
||||
|
||||
return const _UploadSuccess();
|
||||
},
|
||||
),
|
||||
);
|
||||
@ -85,6 +89,6 @@ class _UploadError extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Placeholder();
|
||||
return FlowyText(error.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1535,10 +1535,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
|
||||
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.5"
|
||||
version: "3.1.4"
|
||||
plugin_platform_interface:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@ -1933,10 +1933,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.2.0"
|
||||
string_validator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -2238,10 +2238,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
|
||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.5"
|
||||
version: "14.2.1"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@ -138,7 +138,9 @@ impl AppFlowyServer for AppFlowyCloudServer {
|
||||
match token_state {
|
||||
TokenState::Refresh => match client.get_token() {
|
||||
Ok(token) => {
|
||||
let _ = watch_tx.send(UserTokenState::Refresh { token });
|
||||
if let Err(err) = watch_tx.send(UserTokenState::Refresh { token }) {
|
||||
error!("Failed to send token after token state changed: {}", err);
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
error!("Failed to get token after token state changed: {}", err);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user