fix(gift): 취소 완료 후 제출 상태를 해제한다
This commit is contained in:
@@ -89,8 +89,9 @@ final class GiftDetailViewModel: ObservableObject {
|
|||||||
self.hasCompletedCancellation = true
|
self.hasCompletedCancellation = true
|
||||||
self.isShowingCancelDialog = false
|
self.isShowingCancelDialog = false
|
||||||
self.onCanceled(self.applicationNo) { [weak self] didReplace in
|
self.onCanceled(self.applicationNo) { [weak self] didReplace in
|
||||||
guard let self, !didReplace else { return }
|
guard let self else { return }
|
||||||
self.isCancelSubmitting = false
|
self.isCancelSubmitting = false
|
||||||
|
guard !didReplace else { return }
|
||||||
self.fetch()
|
self.fetch()
|
||||||
}
|
}
|
||||||
} catch {
|
} 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
|
||||||
Reference in New Issue
Block a user