Skip to content

Commit 2b48c13

Browse files
committed
Minor Fixes
1 parent b16d0c8 commit 2b48c13

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

Examples/LocalDebugging/MyApp/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata

-7
This file was deleted.

Examples/LocalDebugging/MyApp/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

-8
This file was deleted.

Examples/LocalDebugging/MyApp/MyApp/ContentView.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftAWSLambdaRuntime open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the SwiftAWSLambdaRuntime project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the SwiftAWSLambdaRuntime project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -29,7 +29,7 @@ struct ContentView: View {
2929
Button {
3030
Task {
3131
isLoading = true
32-
response = await register()
32+
response = await self.register()
3333
isLoading = false
3434
}
3535
} label: {
@@ -45,14 +45,14 @@ struct ContentView: View {
4545
}
4646
}
4747
}
48-
.disabled(buttonDisabled)
48+
.disabled(buttonDisabled || isLoading)
4949
.opacity(buttonDisabled ? 0.5 : 1)
5050
Text(response)
5151
}.padding(100)
5252
}
5353

5454
func register() async -> String {
55-
guard let url = URL(string: "http://localhost:9001/invoke") else {
55+
guard let url = URL(string: "http://127.0.0.1:7000/invoke") else {
5656
fatalError("invalid url")
5757
}
5858
var request = URLRequest(url: url)
@@ -64,17 +64,17 @@ struct ContentView: View {
6464
request.httpBody = jsonRequest
6565

6666
do {
67-
let (data, urlResponse) = try await URLSession.shared.data(for: request)
67+
let (data, response) = try await URLSession.shared.data(for: request)
6868

69-
guard let httpResponse = urlResponse as? HTTPURLResponse else {
69+
guard let httpResponse = response as? HTTPURLResponse else {
7070
return "invalid response, expected HTTPURLResponse"
7171
}
7272
guard httpResponse.statusCode == 200 else {
7373
return "invalid response code: \(httpResponse.statusCode)"
7474
}
7575

76-
let response = try JSONDecoder().decode(Response.self, from: data)
77-
return response.message
76+
let jsonResponse = try JSONDecoder().decode(Response.self, from: data)
77+
return jsonResponse.message
7878
} catch {
7979
return error.localizedDescription
8080
}

scripts/soundness.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1919

2020
function replace_acceptable_years() {
2121
# this needs to replace all acceptable forms with 'YEARS'
22-
sed -e 's/2017-2018/YEARS/' -e 's/2017-2020/YEARS/' -e 's/2017-2021/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/' -e 's/2021/YEARS/'
22+
sed -e 's/2017-2018/YEARS/' -e 's/2017-2020/YEARS/' -e 's/2017-2021/YEARS/' -e 's/2020-2021/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/' -e 's/2021/YEARS/'
2323
}
2424

2525
printf "=> Checking for unacceptable language... "

0 commit comments

Comments
 (0)