Skip to content

Commit bf29bad

Browse files
committed
Reset change count when loading radar
Previously if you started to dup a radar, we filled in all the fields in the window, which sets the document change count to edited. Then if you closed the window, you would be prompted to save the document. In this case where you haven't edited anything, the document will be immediately closable and you will only be prompted to save the document if you make changes to it.
1 parent 56bbb7a commit bf29bad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Brisk/Controllers/RadarViewController.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ final class RadarViewController: ViewController {
8989
self.attachments = radar.attachments
9090

9191
self.enableSubmitIfValid()
92+
self.document?.updateChangeCount(.changeCleared)
9293
}
9394

9495
func currentRadar() -> Radar {
@@ -207,7 +208,7 @@ final class RadarViewController: ViewController {
207208
self.document?.save(self)
208209
}
209210

210-
self.view.window?.close()
211+
self.document?.close()
211212
}
212213
}
213214

0 commit comments

Comments
 (0)