Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions frontend/appflowy_flutter/lib/core/helpers/url_launcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import 'package:open_filex/open_filex.dart';
import 'package:string_validator/string_validator.dart';
import 'package:universal_platform/universal_platform.dart';
import 'package:url_launcher/url_launcher.dart' as launcher;
// ignore: implementation_imports
import 'package:appflowy_editor/src/editor/util/link_util.dart'
show isCustomUrL;

typedef OnFailureCallback = void Function(Uri uri);

Expand Down Expand Up @@ -39,10 +42,12 @@ Future<bool> afLaunchUri(
);
}

// on Linux or Android or Windows, add http scheme to the url if it is not present
// on Linux or Android, add http scheme to the url if it is not present
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Comment doesn’t reflect Windows condition

Please update the comment to include Windows, as the logic applies to Windows when the URL is not custom.

final isNotCustomUrlOnWindows =
UniversalPlatform.isWindows && !isCustomUrL(url);
if ((UniversalPlatform.isLinux ||
UniversalPlatform.isAndroid ||
UniversalPlatform.isWindows) &&
isNotCustomUrlOnWindows) &&
!isURL(url, {'require_protocol': true})) {
uri = Uri.parse('https://$url');
}
Expand Down
Loading