Skip to content

Commit 8b6ddd0

Browse files
committed
fix: last entry optional
1 parent e8d7d76 commit 8b6ddd0

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

Horizon.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@
594594
CODE_SIGN_IDENTITY = "Apple Development";
595595
CODE_SIGN_STYLE = Automatic;
596596
COMBINE_HIDPI_IMAGES = YES;
597-
CURRENT_PROJECT_VERSION = 2;
597+
CURRENT_PROJECT_VERSION = 102;
598598
DEVELOPMENT_ASSET_PATHS = "\"Horizon/Preview Content\"";
599599
DEVELOPMENT_TEAM = LCFAPK739L;
600600
ENABLE_HARDENED_RUNTIME = YES;
@@ -605,7 +605,7 @@
605605
"@executable_path/../Frameworks",
606606
);
607607
MACOSX_DEPLOYMENT_TARGET = 11.0;
608-
MARKETING_VERSION = 1.0;
608+
MARKETING_VERSION = 1.0.2;
609609
PRODUCT_BUNDLE_IDENTIFIER = co.meagher.Horizon;
610610
PRODUCT_NAME = "$(TARGET_NAME)";
611611
SWIFT_VERSION = 5.0;
@@ -621,7 +621,7 @@
621621
CODE_SIGN_IDENTITY = "Apple Development";
622622
CODE_SIGN_STYLE = Automatic;
623623
COMBINE_HIDPI_IMAGES = YES;
624-
CURRENT_PROJECT_VERSION = 2;
624+
CURRENT_PROJECT_VERSION = 102;
625625
DEVELOPMENT_ASSET_PATHS = "\"Horizon/Preview Content\"";
626626
DEVELOPMENT_TEAM = LCFAPK739L;
627627
ENABLE_HARDENED_RUNTIME = YES;
@@ -632,7 +632,7 @@
632632
"@executable_path/../Frameworks",
633633
);
634634
MACOSX_DEPLOYMENT_TARGET = 11.0;
635-
MARKETING_VERSION = 1.0;
635+
MARKETING_VERSION = 1.0.2;
636636
PRODUCT_BUNDLE_IDENTIFIER = co.meagher.Horizon;
637637
PRODUCT_NAME = "$(TARGET_NAME)";
638638
SWIFT_VERSION = 5.0;

Horizon/Horizon.entitlements

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7+
<key>com.apple.security.automation.apple-events</key>
8+
<true/>
79
<key>com.apple.security.files.user-selected.read-only</key>
810
<true/>
911
<key>com.apple.security.network.client</key>

Horizon/Models/Journal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct Journal: Codable, Identifiable {
66
var id: Int
77
var entryTemplate: String?
88
var entryTemplateActive: Bool
9-
var lastEntryAt: Date
9+
var lastEntryAt: Date?
1010
var slug: String
1111
var title: String
1212

Horizon/Publish/PublishViewModel.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ class PublishViewModel: ObservableObject, Identifiable {
6868
}
6969
self.networkActive = false
7070
}, receiveValue: { journals in
71-
let sortedJournals = journals.sorted { $0.lastEntryAt > $1.lastEntryAt }
71+
let sortedJournals = journals.sorted { (a, b) -> Bool in
72+
guard let lastEntryAtA = a.lastEntryAt else { return false }
73+
guard let lastEntryAtB = b.lastEntryAt else { return true }
74+
return lastEntryAtA > lastEntryAtB
75+
}
7276
self.journals = sortedJournals
7377

7478
// Check if a journal is already selected
@@ -108,7 +112,7 @@ class PublishViewModel: ObservableObject, Identifiable {
108112
}
109113
self.networkActive = false
110114
}, receiveValue: { entry in
111-
let entryUrl = "https://futureland.tv/\(self.store.username!)/\(self.selectedJournal!.slug)/\(entry.id)"
115+
let entryUrl = "https://futureland.tv/\(self.store.username!)/\(self.selectedJournal!.slug)/\(entry.id)?fullscreen=1"
112116
let content = UNMutableNotificationContent()
113117
content.title = "Published Entry"
114118
content.body = entry.notes

0 commit comments

Comments
 (0)