Skip to content

Commit

Permalink
Merge pull request #1459 from smartdevicelink/bugfix/issue-1456-examp…
Browse files Browse the repository at this point in the history
…le-app-warning-alert-template-change

Change example app resultCode check to the success bool instead
  • Loading branch information
joeljfischer authored Oct 23, 2019
2 parents 1572861 + 3d38f08 commit 89af6b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Example Apps/Example ObjC/MenuManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ + (SDLMenuCell *)sdlex_menuCellChangeTemplateWithManager:(SDLManager *)manager {
SDLMenuCell *cell = [[SDLMenuCell alloc] initWithTitle:@"Non - Media (Default)" icon:nil voiceCommands:nil handler:^(SDLTriggerSource _Nonnull triggerSource) {
SDLSetDisplayLayout* display = [[SDLSetDisplayLayout alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia];
[manager sendRequest:display withResponseHandler:^(SDLRPCRequest *request, SDLRPCResponse *response, NSError *error) {
if (![response.resultCode isEqualToEnum:SDLResultSuccess]) {
if (!response.success) {
[manager sendRequest:[AlertManager alertWithMessageAndCloseButton:errorMessage textField2:nil iconName:nil]];
}
}];
Expand All @@ -110,7 +110,7 @@ + (SDLMenuCell *)sdlex_menuCellChangeTemplateWithManager:(SDLManager *)manager {
SDLMenuCell *cell2 = [[SDLMenuCell alloc] initWithTitle:@"Graphic With Text" icon:nil voiceCommands:nil handler:^(SDLTriggerSource _Nonnull triggerSource) {
SDLSetDisplayLayout* display = [[SDLSetDisplayLayout alloc] initWithPredefinedLayout:SDLPredefinedLayoutGraphicWithText];
[manager sendRequest:display withResponseHandler:^(SDLRPCRequest *request, SDLRPCResponse *response, NSError *error) {
if (![response.resultCode isEqualToEnum:SDLResultSuccess]) {
if (!response.success) {
[manager sendRequest:[AlertManager alertWithMessageAndCloseButton:errorMessage textField2:nil iconName:nil]];
}
}];
Expand Down
4 changes: 2 additions & 2 deletions Example Apps/Example Swift/MenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private extension MenuManager {
submenuItems.append(SDLMenuCell(title: submenuTitleNonMedia, icon: nil, voiceCommands: nil, handler: { (triggerSource) in
let display = SDLSetDisplayLayout(predefinedLayout: .nonMedia)
manager.send(request: display) { (request, response, error) in
guard response?.resultCode == .success else {
guard response?.success.boolValue == .some(true) else {
manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage))
return
}
Expand All @@ -144,7 +144,7 @@ private extension MenuManager {
submenuItems.append(SDLMenuCell(title: submenuTitleGraphicText, icon: nil, voiceCommands: nil, handler: { (triggerSource) in
let display = SDLSetDisplayLayout(predefinedLayout: .graphicWithText)
manager.send(request: display) { (request, response, error) in
guard response?.resultCode == .success else {
guard response?.success.boolValue == .some(true) else {
manager.send(AlertManager.alertWithMessageAndCloseButton(errorMessage))
return
}
Expand Down

0 comments on commit 89af6b7

Please sign in to comment.