Bug fixes
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
/// To regenerate, run: `dart run slang`
|
||||
///
|
||||
/// Locales: 3
|
||||
/// Strings: 621 (207 per locale)
|
||||
/// Strings: 624 (208 per locale)
|
||||
///
|
||||
/// Built on 2025-04-03 at 20:13 UTC
|
||||
/// Built on 2025-04-03 at 20:45 UTC
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
@@ -296,6 +296,7 @@ class _StringsWebviewEn {
|
||||
String get copyLinkClipboard => 'Copy link to clipboard';
|
||||
String get linkCopiedClipboard => 'Link copied to the clipboard.';
|
||||
String get share => 'Share';
|
||||
String get invalidBookmarkData => 'The bookmark has invalid data or it\'s corrupted.';
|
||||
}
|
||||
|
||||
// Path: colors
|
||||
@@ -709,6 +710,7 @@ class _StringsWebviewEs implements _StringsWebviewEn {
|
||||
@override String get copyLinkClipboard => 'Copiar enlace al portapapeles';
|
||||
@override String get linkCopiedClipboard => 'Enlace copiado al portapapeles.';
|
||||
@override String get share => 'Compartir';
|
||||
@override String get invalidBookmarkData => 'El marcador tiene datos inválidos o está corrupto.';
|
||||
}
|
||||
|
||||
// Path: colors
|
||||
@@ -1122,6 +1124,7 @@ class _StringsWebviewTr implements _StringsWebviewEn {
|
||||
@override String get copyLinkClipboard => 'Bağlantıyı panoya kopyala';
|
||||
@override String get linkCopiedClipboard => 'Bağlantı panoya kopyalandı.';
|
||||
@override String get share => 'Paylaş';
|
||||
@override String get invalidBookmarkData => 'The bookmark has invalid data or it\'s corrupted.';
|
||||
}
|
||||
|
||||
// Path: colors
|
||||
@@ -1566,6 +1569,7 @@ extension on Translations {
|
||||
case 'webview.copyLinkClipboard': return 'Copy link to clipboard';
|
||||
case 'webview.linkCopiedClipboard': return 'Link copied to the clipboard.';
|
||||
case 'webview.share': return 'Share';
|
||||
case 'webview.invalidBookmarkData': return 'The bookmark has invalid data or it\'s corrupted.';
|
||||
case 'colors.red': return 'Red';
|
||||
case 'colors.green': return 'Green';
|
||||
case 'colors.blue': return 'Blue';
|
||||
@@ -1781,6 +1785,7 @@ extension on _StringsEs {
|
||||
case 'webview.copyLinkClipboard': return 'Copiar enlace al portapapeles';
|
||||
case 'webview.linkCopiedClipboard': return 'Enlace copiado al portapapeles.';
|
||||
case 'webview.share': return 'Compartir';
|
||||
case 'webview.invalidBookmarkData': return 'El marcador tiene datos inválidos o está corrupto.';
|
||||
case 'colors.red': return 'Rojo';
|
||||
case 'colors.green': return 'Verde';
|
||||
case 'colors.blue': return 'Azul';
|
||||
@@ -1996,6 +2001,7 @@ extension on _StringsTr {
|
||||
case 'webview.copyLinkClipboard': return 'Bağlantıyı panoya kopyala';
|
||||
case 'webview.linkCopiedClipboard': return 'Bağlantı panoya kopyalandı.';
|
||||
case 'webview.share': return 'Paylaş';
|
||||
case 'webview.invalidBookmarkData': return 'The bookmark has invalid data or it\'s corrupted.';
|
||||
case 'colors.red': return 'Kırmızı';
|
||||
case 'colors.green': return 'Yeşil';
|
||||
case 'colors.blue': return 'Mavi';
|
||||
|
||||
@@ -227,7 +227,8 @@
|
||||
"openInSystemBrowser": "Open in system browser",
|
||||
"copyLinkClipboard": "Copy link to clipboard",
|
||||
"linkCopiedClipboard": "Link copied to the clipboard.",
|
||||
"share": "Share"
|
||||
"share": "Share",
|
||||
"invalidBookmarkData": "The bookmark has invalid data or it's corrupted."
|
||||
},
|
||||
"colors": {
|
||||
"red": "Red",
|
||||
|
||||
@@ -227,7 +227,8 @@
|
||||
"openInSystemBrowser": "Abrir en el navegador del sistema",
|
||||
"copyLinkClipboard": "Copiar enlace al portapapeles",
|
||||
"linkCopiedClipboard": "Enlace copiado al portapapeles.",
|
||||
"share": "Compartir"
|
||||
"share": "Compartir",
|
||||
"invalidBookmarkData": "El marcador tiene datos inválidos o está corrupto."
|
||||
},
|
||||
"colors": {
|
||||
"red": "Rojo",
|
||||
|
||||
@@ -227,7 +227,8 @@
|
||||
"openInSystemBrowser": "Sistem tarayıcısında aç",
|
||||
"copyLinkClipboard": "Bağlantıyı panoya kopyala",
|
||||
"linkCopiedClipboard": "Bağlantı panoya kopyalandı.",
|
||||
"share": "Paylaş"
|
||||
"share": "Paylaş",
|
||||
"invalidBookmarkData": "The bookmark has invalid data or it's corrupted."
|
||||
},
|
||||
"colors": {
|
||||
"red": "Kırmızı",
|
||||
|
||||
@@ -62,14 +62,20 @@ class BookmarkForm extends _$BookmarkForm {
|
||||
}
|
||||
|
||||
void initializeProviderUrl(String url) {
|
||||
final decoded = Uri.decodeComponent(url);
|
||||
var value = decoded.contains(":~:text=") ? decoded.split(":~:text=")[1] : null;
|
||||
state.urlController.text = value ?? decoded;
|
||||
if (Regexps.urlWithoutProtocol.hasMatch(value ?? decoded)) {
|
||||
state.urlError = null;
|
||||
checkUrlDetails(updateState: false);
|
||||
} else {
|
||||
try {
|
||||
final decoded = Uri.decodeComponent(url);
|
||||
var value = decoded.contains(":~:text=") ? decoded.split(":~:text=")[1] : null;
|
||||
state.urlController.text = value ?? decoded;
|
||||
if (Regexps.urlWithoutProtocol.hasMatch(value ?? decoded)) {
|
||||
state.urlError = null;
|
||||
checkUrlDetails(updateState: false);
|
||||
} else {
|
||||
state.urlError = t.bookmarks.addBookmark.invalidUrl;
|
||||
}
|
||||
} catch (e) {
|
||||
state.urlController.text = url;
|
||||
state.urlError = t.bookmarks.addBookmark.invalidUrl;
|
||||
ref.notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:linkdy/screens/webview/ui/webview.dart';
|
||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||
import 'package:linkdy/screens/bookmarks/model/bookmarks.model.dart';
|
||||
import 'package:linkdy/screens/webview/ui/invalid_bookmark.dart';
|
||||
|
||||
import 'package:linkdy/config/sizes.dart';
|
||||
import 'package:linkdy/constants/global_keys.dart';
|
||||
@@ -33,7 +34,7 @@ FutureOr<void> bookmarksRequest(
|
||||
sort: "${type == SortingType.title ? "title" : "added"}_${way == SortingWay.ascendant ? "asc" : "desc"}",
|
||||
);
|
||||
|
||||
if (result.successful == true) {
|
||||
if (result.successful == true && result.content?.results != null && result.content?.count != null) {
|
||||
ref.read(bookmarksProvider).bookmarks = result.content!.results!;
|
||||
ref.read(bookmarksProvider).maxNumber = result.content!.count!;
|
||||
ref.read(bookmarksProvider).currentPage = 0;
|
||||
@@ -89,10 +90,20 @@ class Bookmarks extends _$Bookmarks {
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: _webViewRoute,
|
||||
pageBuilder: (context, state) => CustomTransitionPage(
|
||||
child: WebViewScreen(bookmark: state.extra as Bookmark),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
),
|
||||
pageBuilder: (context, state) {
|
||||
final extra = state.extra;
|
||||
if (extra is Bookmark) {
|
||||
return CustomTransitionPage(
|
||||
child: WebViewScreen(bookmark: extra),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
);
|
||||
} else {
|
||||
return CustomTransitionPage(
|
||||
child: const InvalidBookmarkScreen(),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:linkdy/screens/webview/ui/webview.dart';
|
||||
import 'package:linkdy/screens/bookmarks/provider/bookmarks.provider.dart';
|
||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||
import 'package:linkdy/screens/bookmarks/model/search_bookmarks.model.dart';
|
||||
import 'package:linkdy/screens/webview/ui/invalid_bookmark.dart';
|
||||
|
||||
import 'package:linkdy/config/sizes.dart';
|
||||
import 'package:linkdy/providers/app_status.provider.dart';
|
||||
@@ -30,7 +31,6 @@ FutureOr<void> fetchSearchBookmarks(FetchSearchBookmarksRef ref, int limit) asyn
|
||||
);
|
||||
|
||||
if (result.successful == true) {
|
||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(result.content!.results!);
|
||||
ref.read(searchBookmarksProvider).bookmarks = result.content!.results!;
|
||||
ref.read(searchBookmarksProvider).maxNumber = result.content!.count!;
|
||||
ref.read(searchBookmarksProvider).currentPage = 0;
|
||||
@@ -81,10 +81,20 @@ class SearchBookmarks extends _$SearchBookmarks {
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: _webViewRoute,
|
||||
pageBuilder: (context, state) => CustomTransitionPage(
|
||||
child: WebViewScreen(bookmark: state.extra as Bookmark),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
),
|
||||
pageBuilder: (context, state) {
|
||||
final extra = state.extra;
|
||||
if (extra is Bookmark) {
|
||||
return CustomTransitionPage(
|
||||
child: WebViewScreen(bookmark: extra),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
);
|
||||
} else {
|
||||
return CustomTransitionPage(
|
||||
child: const InvalidBookmarkScreen(),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:linkdy/screens/webview/ui/webview.dart';
|
||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||
import 'package:linkdy/screens/bookmarks/provider/bookmarks.provider.dart';
|
||||
import 'package:linkdy/screens/filtered_bookmarks/model/filtered_bookmarks.model.dart';
|
||||
import 'package:linkdy/screens/webview/ui/invalid_bookmark.dart';
|
||||
|
||||
import 'package:linkdy/config/sizes.dart';
|
||||
import 'package:linkdy/constants/global_keys.dart';
|
||||
@@ -35,7 +36,6 @@ FutureOr<void> tagBookmarksRequest(TagBookmarksRequestRef ref, Tag? tag, String?
|
||||
);
|
||||
|
||||
if (bookmarksResult.successful == true) {
|
||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(bookmarksResult.content!.results!);
|
||||
ref.read(filteredBookmarksProvider).bookmarks = bookmarksResult.content!.results!;
|
||||
ref.read(filteredBookmarksProvider).maxNumber = bookmarksResult.content!.count!;
|
||||
if (tag == null) ref.read(filteredBookmarksProvider).tag = tagResult!.content!;
|
||||
@@ -83,7 +83,6 @@ FutureOr<void> filteredBookmarksRequest(FilteredBookmarksRequestRef ref, Filtere
|
||||
);
|
||||
|
||||
if (bookmarksResult.successful == true) {
|
||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(bookmarksResult.content!.results!);
|
||||
ref.read(filteredBookmarksProvider).bookmarks = bookmarksResult.content!.results!;
|
||||
ref.read(filteredBookmarksProvider).maxNumber = bookmarksResult.content!.count!;
|
||||
ref.read(filteredBookmarksProvider).currentPage = 0;
|
||||
@@ -115,7 +114,6 @@ FutureOr<void> filteredBookmarksRequestLoadMore(TagBookmarksRequestLoadMoreRef r
|
||||
);
|
||||
|
||||
if (result.successful == true) {
|
||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(result.content!.results!);
|
||||
provider.bookmarks = [...provider.bookmarks, ...result.content!.results!];
|
||||
provider.maxNumber = result.content!.count!;
|
||||
provider.currentPage = provider.currentPage + 1;
|
||||
@@ -141,10 +139,20 @@ class FilteredBookmarks extends _$FilteredBookmarks {
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: _webViewRoute,
|
||||
pageBuilder: (context, state) => CustomTransitionPage(
|
||||
child: WebViewScreen(bookmark: state.extra as Bookmark),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
),
|
||||
pageBuilder: (context, state) {
|
||||
final extra = state.extra;
|
||||
if (extra is Bookmark) {
|
||||
return CustomTransitionPage(
|
||||
child: WebViewScreen(bookmark: extra),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
);
|
||||
} else {
|
||||
return CustomTransitionPage(
|
||||
child: const InvalidBookmarkScreen(),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
18
lib/screens/webview/ui/invalid_bookmark.dart
Normal file
18
lib/screens/webview/ui/invalid_bookmark.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:linkdy/i18n/strings.g.dart';
|
||||
|
||||
import 'package:linkdy/widgets/error_screen.dart';
|
||||
|
||||
class InvalidBookmarkScreen extends StatelessWidget {
|
||||
const InvalidBookmarkScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: Center(
|
||||
child: ErrorScreen(error: t.webview.invalidBookmarkData),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user