mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-04-18 23:02:52 +00:00
display message if limit is reached
This commit is contained in:
parent
8ae729f53d
commit
4005ab6bc7
7 changed files with 36 additions and 0 deletions
|
|
@ -20,6 +20,9 @@ enum UploadState {
|
||||||
uploaded,
|
uploaded,
|
||||||
|
|
||||||
uploadLimitReached,
|
uploadLimitReached,
|
||||||
|
|
||||||
|
// File is to big to be uploaded
|
||||||
|
fileLimitReached,
|
||||||
// readyToUpload,
|
// readyToUpload,
|
||||||
// uploadTaskStarted,
|
// uploadTaskStarted,
|
||||||
// receiverNotified,
|
// receiverNotified,
|
||||||
|
|
|
||||||
|
|
@ -2104,6 +2104,12 @@ abstract class AppLocalizations {
|
||||||
/// **'The upload limit has\nbeen reached. Upgrade to Pro\nor wait until tomorrow.'**
|
/// **'The upload limit has\nbeen reached. Upgrade to Pro\nor wait until tomorrow.'**
|
||||||
String get uploadLimitReached;
|
String get uploadLimitReached;
|
||||||
|
|
||||||
|
/// No description provided for @fileLimitReached.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Maximum file size\nexceeded'**
|
||||||
|
String get fileLimitReached;
|
||||||
|
|
||||||
/// No description provided for @retransmissionRequested.
|
/// No description provided for @retransmissionRequested.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|
|
||||||
|
|
@ -1116,6 +1116,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||||
String get uploadLimitReached =>
|
String get uploadLimitReached =>
|
||||||
'Das Upload-Limit wurde\nerreicht. Upgrade auf Pro\noder warte bis morgen.';
|
'Das Upload-Limit wurde\nerreicht. Upgrade auf Pro\noder warte bis morgen.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get fileLimitReached => 'Maximale Dateigröße\nerreicht';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get retransmissionRequested => 'Wird erneut versucht.';
|
String get retransmissionRequested => 'Wird erneut versucht.';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1109,6 +1109,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||||
String get uploadLimitReached =>
|
String get uploadLimitReached =>
|
||||||
'The upload limit has\nbeen reached. Upgrade to Pro\nor wait until tomorrow.';
|
'The upload limit has\nbeen reached. Upgrade to Pro\nor wait until tomorrow.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get fileLimitReached => 'Maximum file size\nexceeded';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get retransmissionRequested => 'Retransmission requested';
|
String get retransmissionRequested => 'Retransmission requested';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1109,6 +1109,9 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||||
String get uploadLimitReached =>
|
String get uploadLimitReached =>
|
||||||
'The upload limit has\nbeen reached. Upgrade to Pro\nor wait until tomorrow.';
|
'The upload limit has\nbeen reached. Upgrade to Pro\nor wait until tomorrow.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get fileLimitReached => 'Maximum file size\nexceeded';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get retransmissionRequested => 'Retransmission requested';
|
String get retransmissionRequested => 'Retransmission requested';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,11 @@ Future<void> _createUploadRequest(MediaFileService media) async {
|
||||||
|
|
||||||
final uploadRequestBytes = uploadRequest.writeToBuffer();
|
final uploadRequestBytes = uploadRequest.writeToBuffer();
|
||||||
|
|
||||||
|
if (uploadRequestBytes.length > 49_000_000) {
|
||||||
|
await media.setUploadState(UploadState.fileLimitReached);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await media.uploadRequestPath.writeAsBytes(uploadRequestBytes);
|
await media.uploadRequestPath.writeAsBytes(uploadRequestBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,19 @@ class _MessageSendStateIconState extends State<MessageSendStateIcon> {
|
||||||
context.lang.uploadLimitReached,
|
context.lang.uploadLimitReached,
|
||||||
style: const TextStyle(fontSize: 9),
|
style: const TextStyle(fontSize: 9),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mediaFile.uploadState == UploadState.fileLimitReached) {
|
||||||
|
icon = FaIcon(
|
||||||
|
FontAwesomeIcons.triangleExclamation,
|
||||||
|
size: 12,
|
||||||
|
color: color,
|
||||||
|
);
|
||||||
|
|
||||||
|
textWidget = Text(
|
||||||
|
context.lang.fileLimitReached,
|
||||||
|
style: const TextStyle(fontSize: 9),
|
||||||
|
);
|
||||||
|
|
||||||
onTap = () => context.push(Routes.settingsSubscription);
|
onTap = () => context.push(Routes.settingsSubscription);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue