mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Clear last draft when holding Shift key on Mac app launch
This commit is contained in:
parent
900ef269ba
commit
9bc4532193
@ -9,11 +9,12 @@ struct CheckForDebugModifier {
|
||||
static func main() {
|
||||
#if os(macOS)
|
||||
if NSEvent.modifierFlags.contains(.shift) {
|
||||
print("Debug launch detected")
|
||||
// Run debug-mode launch code here
|
||||
// Clear the launch-to-last-draft values to load a new draft.
|
||||
UserDefaults.standard.setValue(false, forKey: "showAllPostsFlag")
|
||||
UserDefaults.standard.setValue(nil, forKey: "selectedCollectionURL")
|
||||
UserDefaults.standard.setValue(nil, forKey: "lastDraftURL")
|
||||
} else {
|
||||
print("Normal launch detected")
|
||||
// Don't do anything
|
||||
// No-op
|
||||
}
|
||||
#endif
|
||||
WriteFreely_MultiPlatformApp.main()
|
||||
|
Loading…
Reference in New Issue
Block a user