fix sublist routine
This commit is contained in:
parent
ea62890ba0
commit
9b67dca0e8
|
@ -98,8 +98,8 @@ Future<void> _postOnMastodon(reqJson) async {
|
|||
// If there are more than four photos, move other photos to another array to be posted in the thread.
|
||||
List<String> otherPhotos = [];
|
||||
if (photoUrls.length > 4) {
|
||||
otherPhotos = photos.skip(4).toList();
|
||||
photoUrls = photos.take(4).toList();
|
||||
otherPhotos = photoUrls.sublist(4);
|
||||
photoUrls = photoUrls.sublist(0, 4);
|
||||
}
|
||||
|
||||
// Post the post on Mastodon.
|
||||
|
@ -143,8 +143,8 @@ Future<void> _postOnMastodon(reqJson) async {
|
|||
while (otherPhotos.isNotEmpty) {
|
||||
mediaIds = [];
|
||||
if (otherPhotos.length > 4) {
|
||||
otherPhotos = otherPhotos.skip(4).toList();
|
||||
photoUrls = otherPhotos.take(4).toList();
|
||||
otherPhotos = photoUrls.sublist(4);
|
||||
photoUrls = photoUrls.sublist(0, 4);
|
||||
} else {
|
||||
photoUrls = otherPhotos;
|
||||
otherPhotos = [];
|
||||
|
|
Loading…
Reference in a new issue