Skip to content

Commit

Permalink
Merge pull request #80 from kkebo/fix-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kkebo authored Dec 22, 2024
2 parents 3ac21e6 + 706f8b1 commit 26710a1
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Sources/Components/Layouts/ToySection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct ToySection<Title: View, Content: View> {
self.content = content()
}

@MainActor
init<Toolbar: View>(
_ titleKey: LocalizedStringKey,
@ViewBuilder toolbar: () -> Toolbar,
Expand All @@ -43,6 +44,7 @@ struct ToySection<Title: View, Content: View> {
}

@_disfavoredOverload
@MainActor
init<S: StringProtocol, Toolbar: View>(
_ title: S,
@ViewBuilder toolbar: () -> Toolbar,
Expand All @@ -56,6 +58,7 @@ struct ToySection<Title: View, Content: View> {
self.content = content()
}

@MainActor
init<T: View, Toolbar: View>(
@ViewBuilder _ title: () -> T,
@ViewBuilder toolbar: () -> Toolbar,
Expand Down
2 changes: 1 addition & 1 deletion Sources/DevToysApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let logger = Logger(label: "main")
@main
struct DevToysApp {
init() {
LoggingSystem.bootstrap(PlaygroundHandler.init)
LoggingSystem.bootstrap { PlaygroundHandler(label: $0) }
}
}

Expand Down
3 changes: 3 additions & 0 deletions Sources/Pages/Coders/JWTDecoderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extension JWTDecoderView: View {
.navigationTitle("JWT Decoder")
}

@MainActor
private var inputSection: some View {
ToySection("JWT Token") {
PasteButton(text: self.$state.input)
Expand All @@ -29,6 +30,7 @@ extension JWTDecoderView: View {
}
}

@MainActor
private var headerSection: some View {
ToySection("Header") {
CopyButton(text: self.state.header)
Expand All @@ -38,6 +40,7 @@ extension JWTDecoderView: View {
}
}

@MainActor
private var payloadSection: some View {
ToySection("Payload") {
CopyButton(text: self.state.payload)
Expand Down
2 changes: 2 additions & 0 deletions Sources/Pages/Converters/JSONYAMLConverterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extension JSONYAMLConverterView: View {
.navigationTitle(Tool.jsonYAMLConverter.strings.localizedLongTitle)
}

@MainActor
private var inputSection: some View {
ToySection("Input") {
PasteButton(text: self.$state.input)
Expand All @@ -59,6 +60,7 @@ extension JSONYAMLConverterView: View {
}
}

@MainActor
private var outputSection: some View {
ToySection("Output") {
CopyButton(text: self.state.output)
Expand Down
1 change: 1 addition & 0 deletions Sources/Pages/Converters/TimestampConverterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ extension TimestampConverterView: View {
.navigationTitle(Tool.timestampConverter.strings.localizedLongTitle)
}

@MainActor
private var timestampSection: some View {
ToySection("Timestamp") {
PasteButton(text: self.$state.timestampString)
Expand Down
1 change: 1 addition & 0 deletions Sources/Pages/Converters/TimestampConverterViewState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class TimestampConverterViewState {
}
private(set) var timestamp: Int?

@MainActor
var date: Binding<Date> {
.init(
get: {
Expand Down
2 changes: 2 additions & 0 deletions Sources/Pages/Formatters/JSONFormatterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extension JSONFormatterView: View {
.navigationTitle(Tool.jsonFormatter.strings.localizedLongTitle)
}

@MainActor
private var inputSection: some View {
ToySection("Input") {
PasteButton(text: self.$state.input)
Expand All @@ -48,6 +49,7 @@ extension JSONFormatterView: View {
}
}

@MainActor
private var outputSection: some View {
ToySection("Output") {
CopyButton(text: self.state.output)
Expand Down
1 change: 1 addition & 0 deletions Sources/Pages/Generators/HashGeneratorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ extension HashGeneratorView: View {
.navigationTitle(Tool.hashGenerator.strings.localizedLongTitle)
}

@MainActor
private var inputSection: some View {
ToySection("Input") {
PasteButton(text: self.$state.input)
Expand Down
3 changes: 3 additions & 0 deletions Sources/Pages/Generators/UUIDGeneratorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extension UUIDGeneratorView: View {
.navigationTitle(Tool.uuidGenerator.strings.localizedLongTitle)
}

@MainActor
private var configurationSection: some View {
ToySection("Configuration") {
ConfigurationRow("Hyphens", systemImage: "minus") {
Expand Down Expand Up @@ -47,6 +48,7 @@ extension UUIDGeneratorView: View {
}
}

@MainActor
private var generateSection: some View {
ToySection("Generate") {
HStack {
Expand Down Expand Up @@ -80,6 +82,7 @@ extension UUIDGeneratorView: View {
}
}

@MainActor
private var outputSection: some View {
ToySection(
self.state.numberOfUUIDs > 1 ? "UUIDs" : "UUID"
Expand Down
2 changes: 2 additions & 0 deletions Sources/Pages/Text/ListComparerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extension ListComparerView: View {
.navigationTitle(Tool.listComparer.strings.localizedLongTitle)
}

@MainActor
private var sectionA: some View {
ToySection("A") {
PasteButton(text: self.$state.a)
Expand All @@ -56,6 +57,7 @@ extension ListComparerView: View {
}
}

@MainActor
private var sectionB: some View {
ToySection("B") {
PasteButton(text: self.$state.b)
Expand Down
2 changes: 2 additions & 0 deletions Sources/Pages/Text/MarkdownPreviewView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extension MarkdownPreviewView: View {
.navigationTitle(Tool.markdownPreview.strings.localizedLongTitle)
}

@MainActor
private var markdownSection: some View {
ToySection("Markdown") {
PasteButton(text: self.$state.input)
Expand All @@ -37,6 +38,7 @@ extension MarkdownPreviewView: View {
}
}

@MainActor
private var previewSection: some View {
ToySection("Preview") {
CopyButton(text: self.state.output)
Expand Down

0 comments on commit 26710a1

Please sign in to comment.