clean up media attachment update
This commit is contained in:
parent
55fb99d9d9
commit
f324e43be3
|
@ -64,7 +64,6 @@ class _MakePostState extends State<MakePost> {
|
||||||
|
|
||||||
final index = files.indexOf(file);
|
final index = files.indexOf(file);
|
||||||
final newIndex = (index + (up ? -1 : 1)) % files.length;
|
final newIndex = (index + (up ? -1 : 1)) % files.length;
|
||||||
print(newIndex);
|
|
||||||
|
|
||||||
files.remove(file);
|
files.remove(file);
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -247,25 +246,25 @@ class _MakePostState extends State<MakePost> {
|
||||||
// upload the media attachments
|
// upload the media attachments
|
||||||
List<String> mediaIds = [];
|
List<String> mediaIds = [];
|
||||||
for (var file in files) {
|
for (var file in files) {
|
||||||
|
print("blip");
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
status =
|
status =
|
||||||
"${"sending-file".i18n()}${mediaIds.length + 1}/${files.length}";
|
"${"sending-file".i18n()} ${mediaIds.length + 1}/${files.length}";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
final response = await file.upload(accountid);
|
final response = await file.upload(accountid);
|
||||||
if (response.key == 200 || response.key == 202) {
|
if (response.key == 200 || response.key == 202) {
|
||||||
mediaIds.add(response.value);
|
mediaIds.add(response.value);
|
||||||
break;
|
} else if (mounted) {
|
||||||
}
|
|
||||||
if (mounted) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
status = response.value;
|
status = response.value;
|
||||||
sending = false;
|
sending = false;
|
||||||
return;
|
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print(mediaIds);
|
print(mediaIds);
|
||||||
|
|
||||||
// send the final post
|
// send the final post
|
||||||
|
|
|
@ -73,6 +73,17 @@
|
||||||
"instances": "instances",
|
"instances": "instances",
|
||||||
"instance": "instace",
|
"instance": "instace",
|
||||||
"post-found-on": "found post on",
|
"post-found-on": "found post on",
|
||||||
"show-in-full": "show in full"
|
"show-in-full": "show in full",
|
||||||
|
"block": "banish",
|
||||||
|
"unblock": "unbanish",
|
||||||
|
"add-files": "add files",
|
||||||
|
"remaining": "remaining",
|
||||||
|
"move-down": "move down",
|
||||||
|
"move-up": "move up",
|
||||||
|
"remove-attached-file": "remove attachment",
|
||||||
|
"file-description": "file description",
|
||||||
|
"loading...": "loading",
|
||||||
|
"failed-to-send": "failed to send!",
|
||||||
|
"sending-file": "sending file"
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,13 +75,12 @@ ThemeData getTheme(CustomColors colors) {
|
||||||
color: colors.colorScheme.onSurface,
|
color: colors.colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ButtonStyle(
|
||||||
foregroundColor: colors.colorScheme.onPrimary,
|
textStyle: MaterialStateProperty.resolveWith((states) =>
|
||||||
textStyle: const TextStyle(
|
const TextStyle(
|
||||||
fontFamily: 'Atkinson',
|
fontSize: 18,
|
||||||
fontSize: 18,
|
fontFamily: "atkinson",
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||||
|
|
Loading…
Reference in New Issue