fix(gift): 취소 완료 후 제출 상태를 해제한다

This commit is contained in:
Yu Sung
2026-10-08 17:36:42 +09:00
parent 35a98c2259
commit 2ae2a6b494
2 changed files with 23 additions and 1 deletions
@@ -89,8 +89,9 @@ final class GiftDetailViewModel: ObservableObject {
self.hasCompletedCancellation = true
self.isShowingCancelDialog = false
self.onCanceled(self.applicationNo) { [weak self] didReplace in
guard let self, !didReplace else { return }
guard let self else { return }
self.isCancelSubmitting = false
guard !didReplace else { return }
self.fetch()
}
} catch {
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
ruby - "$root" <<'RUBY'
root = ARGV.fetch(0)
source = File.read(File.join(root, 'SodaLive/Sources/V2/Gift/Detail/GiftDetailViewModel.swift'))
.gsub(%r{"(?:\\.|[^"\\])*"|//[^\n]*|/\*.*?\*/}m) { |token| token.start_with?('"') ? token : '' }
.gsub(/\s+/, ' ').gsub(/\s*([(),:])\s*/, '\1').strip
completion = source[/self\.onCanceled\(self\.applicationNo\)\s*\{ \[weak self\] didReplace in (.*?) self\.fetch\(\)\s*\}/, 1]
abort 'RED gift-detail cancel loading: cancellation completion block not found' unless completion
reset = completion.index('self.isCancelSubmitting = false')
successful_return = completion.index('guard !didReplace else { return }')
unless reset && successful_return && reset < successful_return
abort 'RED gift-detail cancel loading: successful replacement must clear isCancelSubmitting before returning'
end
puts 'PASS gift-detail cancel loading: successful replacement clears submission state'
RUBY