summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2020-06-24 11:19:06 -0400
committerNicoleYarroch <nicole@livio.io>2020-06-24 11:19:06 -0400
commit34bf0714193728c8f3e351960bc39ae38c9a166a (patch)
tree828075353f0197052a8f619241c0deb46c13c548
parentf0c104cf3cef6d8f5458d7723197dcd02ae90f1d (diff)
downloadsdl_ios-34bf0714193728c8f3e351960bc39ae38c9a166a.tar.gz
Updated button state check for images
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink/SDLSoftButtonReplaceOperation.m9
1 files changed, 5 insertions, 4 deletions
diff --git a/SmartDeviceLink/SDLSoftButtonReplaceOperation.m b/SmartDeviceLink/SDLSoftButtonReplaceOperation.m
index 979bd1bcd..1e34308ad 100644
--- a/SmartDeviceLink/SDLSoftButtonReplaceOperation.m
+++ b/SmartDeviceLink/SDLSoftButtonReplaceOperation.m
@@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
}
[weakself finishOperation];
}];
- } else if ([self sdl_currentStateHasImages] && ![self sdl_allCurrentStateImagesAreUploaded]) {
+ } else if (![self sdl_allStateImagesAreUploaded]) {
// If there are images that aren't uploaded
// Send text buttons if all the soft buttons have text
[self sdl_sendCurrentStateTextOnlySoftButtonsWithCompletionHandler:^(BOOL success) {}];
@@ -261,10 +261,11 @@ NS_ASSUME_NONNULL_BEGIN
return NO;
}
-- (BOOL)sdl_allCurrentStateImagesAreUploaded {
+- (BOOL)sdl_allStateImagesAreUploaded {
for (SDLSoftButtonObject *button in self.softButtonObjects) {
- SDLArtwork *artwork = button.currentState.artwork;
- if ([self sdl_artworkNeedsUpload:artwork]) {
+ for (SDLSoftButtonState *state in button.states) {
+ SDLArtwork *artwork = state.artwork;
+ if (![self sdl_artworkNeedsUpload:artwork]) { continue; }
return NO;
}
}