Skip to content

Commit

Permalink
fixup! fixup! TW-1699: change avatar updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Te-Z committed May 7, 2024
1 parent 0272691 commit 91419cf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/config/go_routes/go_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ abstract class AppRoutes {
path: '/home',
pageBuilder: (context, state) => defaultPageBuilder(
context,
PlatformInfos.isMobile || PlatformInfos.isLinux
PlatformInfos.isMobile || PlatformInfos.isDesktop
? const TwakeWelcome()
: AutoHomeserverPicker(
loggedOut: state.extra is bool ? state.extra as bool? : null,
Expand Down
2 changes: 2 additions & 0 deletions lib/domain/model/extensions/xfile_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extension XFileExtension on XFile {
name: name,
filePath: path,
sizeInBytes: await length(),
readStream: readAsBytes().asStream(),
);
}

Expand All @@ -19,6 +20,7 @@ extension XFileExtension on XFile {
'path': path,
'bytes': await readAsBytes(),
'size': await length(),
'readStream': readAsBytes().asStream(),
});
}
}
2 changes: 1 addition & 1 deletion lib/pages/image_viewer/image_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ImageViewerController extends State<ImageViewer> {
@override
void initState() {
super.initState();
if (!PlatformInfos.isWebOrDesktop && widget.event != null) {
if (PlatformInfos.isMobile && widget.event != null) {
handleDownloadFile(widget.event!);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import 'package:fluffychat/utils/dialog/twake_dialog.dart';
import 'package:fluffychat/utils/extension/value_notifier_extension.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/twake_snackbar.dart';
import 'package:fluffychat/utils/xfile_groups.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:fluffychat/widgets/mixins/popup_context_menu_action_mixin.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_mixin.dart';
Expand Down Expand Up @@ -191,16 +192,12 @@ class SettingsProfileController extends State<SettingsProfile>
void _getImageOnDesktop(
BuildContext context,
) async {
const XTypeGroup typeGroup = XTypeGroup(
label: 'images',
extensions: <String>['jpg', 'png'],
);
final String initialDirectory =
(await getApplicationDocumentsDirectory()).path;

final XFile? result = await openFile(
initialDirectory: initialDirectory,
acceptedTypeGroups: [typeGroup],
acceptedTypeGroups: [XFileGroups.images],
);

Logs().d(
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/mixins/connect_page_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mixin ConnectPageMixin {
);
final urlScheme = _getRedirectUrlScheme(redirectUrl);

return FlutterWebAuth2.authenticate(
return await FlutterWebAuth2.authenticate(
url: url,
callbackUrlScheme: urlScheme,
options: const FlutterWebAuth2Options(
Expand Down
8 changes: 8 additions & 0 deletions lib/utils/xfile_groups.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:file_selector/file_selector.dart';

class XFileGroups {
static const XTypeGroup images = XTypeGroup(
label: 'images',
extensions: <String>['jpg', 'png'],
);
}

0 comments on commit 91419cf

Please sign in to comment.