Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
/ harmonie Public archive

Commit 2cfc8d2

Browse files
authored
Merge pull request #192 from makinosp/develop
Develop
2 parents e61055d + caf0ddb commit 2cfc8d2

File tree

4 files changed

+36
-23
lines changed

4 files changed

+36
-23
lines changed

Harmonie.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@
474474
"$(inherited)",
475475
"@executable_path/Frameworks",
476476
);
477-
MARKETING_VERSION = 0.9.8;
477+
MARKETING_VERSION = 0.9.9;
478478
PRODUCT_BUNDLE_IDENTIFIER = jp.mknn.harmonie;
479479
PRODUCT_NAME = "$(TARGET_NAME)";
480480
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -510,7 +510,7 @@
510510
"$(inherited)",
511511
"@executable_path/Frameworks",
512512
);
513-
MARKETING_VERSION = 0.9.8;
513+
MARKETING_VERSION = 0.9.9;
514514
PRODUCT_BUNDLE_IDENTIFIER = jp.mknn.harmonie;
515515
PRODUCT_NAME = "$(TARGET_NAME)";
516516
SWIFT_EMIT_LOC_STRINGS = YES;

harmonie/Localization/Localizable.xcstrings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,16 @@
13231323
}
13241324
}
13251325
},
1326+
"Try again later" : {
1327+
"localizations" : {
1328+
"ja" : {
1329+
"stringUnit" : {
1330+
"state" : "translated",
1331+
"value" : "もう一度お試しください"
1332+
}
1333+
}
1334+
}
1335+
},
13261336
"Two-step verification" : {
13271337
"localizations" : {
13281338
"ja" : {

harmonie/Modifiers/View+ErrorAlertModifier.swift

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,28 @@ extension ErrorAlertModifier: ViewModifier {
3636
func body(content: Content) -> some View {
3737
@Bindable var appVM = appVM
3838
content
39-
.alert(
40-
isPresented: isThrownError(\.vrckError),
41-
error: appVM.vrckError
42-
) { _ in
43-
Button("OK") {
44-
action()
45-
}
46-
} message: { error in
47-
Text(error.failureReason ?? "Try again later.")
48-
}
49-
.alert(
50-
isPresented: isThrownError(\.applicationError),
51-
error: appVM.applicationError
52-
) { _ in
53-
Button("OK") {
54-
action()
55-
}
56-
} message: { error in
57-
Text(error.failureReason ?? "Try again later.")
58-
}
39+
.errorAlert(isThrownError(\.vrckError), appVM.vrckError, action)
40+
.errorAlert(isThrownError(\.applicationError), appVM.applicationError, action)
41+
}
42+
}
43+
44+
private extension View {
45+
func errorAlert<E>(
46+
_ isPresented: Binding<Bool>,
47+
_ error: E?,
48+
_ action: @escaping () -> Void
49+
) -> some View where E: LocalizedError {
50+
alert(
51+
isPresented: isPresented,
52+
error: error
53+
) { _ in
54+
Button("OK", action: action)
55+
} message: { error in
56+
errorText(error)
57+
}
58+
}
59+
60+
private func errorText<E>(_ error: E) -> Text where E: LocalizedError {
61+
Text(verbatim: error.failureReason ?? String(localized: "Try again later"))
5962
}
6063
}

harmonie/Previews/Models/Instance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension PreviewData {
2626
instanceId(casino): Instance(world: casino, userCount: 25),
2727
instanceId(fuji): Instance(world: fuji, userCount: 25),
2828
instanceId(chinatown): Instance(world: chinatown, userCount: 25),
29-
instanceId(nightCity): Instance(world: nightCity, userCount: 25),
29+
instanceId(nightCity): Instance(world: nightCity, userCount: 25)
3030
]
3131
}
3232

0 commit comments

Comments
 (0)