Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.

Commit e21547c

Browse files
Julian KahnertJulian Kahnert
authored andcommitted
+ bugfix in document deletion
+ optional document description + layout fix in ScanTabView on iPad + build number bump
1 parent d4461b8 commit e21547c

File tree

7 files changed

+34
-22
lines changed

7 files changed

+34
-22
lines changed

ArchiveCore/Sources/ArchiveBackend/Models/Document.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ public final class Document: ObservableObject, Identifiable, Codable, Log {
200200
guard !tags.isEmpty else {
201201
throw FolderProviderError.tags
202202
}
203-
guard !specification.isEmpty else {
204-
throw FolderProviderError.description
205-
}
203+
// 😡 because Finn does not need a description 🤷🏻‍♂️
204+
// guard !specification.isEmpty else {
205+
// throw FolderProviderError.description
206+
// }
206207

207208
let filename = Document.createFilename(date: date, specification: specification, tags: tags)
208209
let foldername = String(filename.prefix(4))

ArchiveCore/Sources/ArchiveViews/ArchiveTab/ArchiveViewModel.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,25 @@ final class ArchiveViewModel: ObservableObject, Log {
165165
}
166166

167167
func delete(at offsets: IndexSet) {
168-
for index in offsets {
169-
let deletedDocument = documents.remove(at: index)
168+
let documentsToDelete = offsets.map { self.documents[$0] }
169+
DispatchQueue.global(qos: .userInitiated).async {
170+
var deletedDocuments = [Document]()
170171
do {
171-
try archiveStore.delete(deletedDocument)
172+
defer {
173+
DispatchQueue.main.async {
174+
self.documents.removeAll { deletedDocuments.contains($0) }
175+
}
176+
}
177+
178+
for document in documentsToDelete {
179+
try self.archiveStore.delete(document)
180+
deletedDocuments.append(document)
181+
}
182+
FeedbackGenerator.notify(.success)
172183
} catch {
173184
NotificationCenter.default.postAlert(error)
174185
}
175186
}
176-
FeedbackGenerator.notify(.success)
177187
}
178188

179189
func selected(filterItem: FilterItem) {

ArchiveCore/Sources/ArchiveViews/ScanTab/ScanTabView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public struct ScanTabView: View {
103103
.padding(.horizontal)
104104
}
105105
.padding()
106+
.frame(maxWidth: 400)
106107
}
107108
#endif
108109
}

PDFArchiver.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@
10141014
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
10151015
CODE_SIGN_ENTITLEMENTS = iOS/PDFArchiver.entitlements;
10161016
CODE_SIGN_STYLE = Automatic;
1017-
CURRENT_PROJECT_VERSION = 2;
1017+
CURRENT_PROJECT_VERSION = 3;
10181018
DEVELOPMENT_TEAM = 87KNVHZ8C7;
10191019
ENABLE_PREVIEWS = YES;
10201020
INFOPLIST_FILE = iOS/Info.plist;
@@ -1041,7 +1041,7 @@
10411041
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
10421042
CODE_SIGN_ENTITLEMENTS = iOS/PDFArchiver.entitlements;
10431043
CODE_SIGN_STYLE = Automatic;
1044-
CURRENT_PROJECT_VERSION = 2;
1044+
CURRENT_PROJECT_VERSION = 3;
10451045
DEVELOPMENT_TEAM = 87KNVHZ8C7;
10461046
ENABLE_PREVIEWS = YES;
10471047
INFOPLIST_FILE = iOS/Info.plist;
@@ -1070,7 +1070,7 @@
10701070
CODE_SIGN_IDENTITY = "Apple Development";
10711071
CODE_SIGN_STYLE = Automatic;
10721072
COMBINE_HIDPI_IMAGES = YES;
1073-
CURRENT_PROJECT_VERSION = 10;
1073+
CURRENT_PROJECT_VERSION = 11;
10741074
DEVELOPMENT_TEAM = 87KNVHZ8C7;
10751075
ENABLE_HARDENED_RUNTIME = YES;
10761076
ENABLE_PREVIEWS = YES;
@@ -1097,7 +1097,7 @@
10971097
CODE_SIGN_IDENTITY = "Apple Development";
10981098
CODE_SIGN_STYLE = Automatic;
10991099
COMBINE_HIDPI_IMAGES = YES;
1100-
CURRENT_PROJECT_VERSION = 10;
1100+
CURRENT_PROJECT_VERSION = 11;
11011101
DEVELOPMENT_TEAM = 87KNVHZ8C7;
11021102
ENABLE_HARDENED_RUNTIME = YES;
11031103
ENABLE_PREVIEWS = YES;
@@ -1210,7 +1210,7 @@
12101210
CLANG_ENABLE_MODULES = YES;
12111211
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
12121212
CODE_SIGN_STYLE = Automatic;
1213-
CURRENT_PROJECT_VERSION = 2;
1213+
CURRENT_PROJECT_VERSION = 3;
12141214
DEVELOPMENT_TEAM = 87KNVHZ8C7;
12151215
INFOPLIST_FILE = ShareExtension/Info.plist;
12161216
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -1237,7 +1237,7 @@
12371237
CLANG_ENABLE_MODULES = YES;
12381238
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
12391239
CODE_SIGN_STYLE = Automatic;
1240-
CURRENT_PROJECT_VERSION = 2;
1240+
CURRENT_PROJECT_VERSION = 3;
12411241
DEVELOPMENT_TEAM = 87KNVHZ8C7;
12421242
INFOPLIST_FILE = ShareExtension/Info.plist;
12431243
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -1308,7 +1308,7 @@
13081308
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
13091309
CODE_SIGN_ENTITLEMENTS = AppClip/AppClip.entitlements;
13101310
CODE_SIGN_STYLE = Automatic;
1311-
CURRENT_PROJECT_VERSION = 2;
1311+
CURRENT_PROJECT_VERSION = 3;
13121312
DEVELOPMENT_ASSET_PATHS = "\"AppClip/Preview Content\"";
13131313
DEVELOPMENT_TEAM = 87KNVHZ8C7;
13141314
ENABLE_PREVIEWS = YES;
@@ -1335,7 +1335,7 @@
13351335
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
13361336
CODE_SIGN_ENTITLEMENTS = AppClip/AppClip.entitlements;
13371337
CODE_SIGN_STYLE = Automatic;
1338-
CURRENT_PROJECT_VERSION = 2;
1338+
CURRENT_PROJECT_VERSION = 3;
13391339
DEVELOPMENT_ASSET_PATHS = "\"AppClip/Preview Content\"";
13401340
DEVELOPMENT_TEAM = 87KNVHZ8C7;
13411341
ENABLE_PREVIEWS = YES;

Shared/Resources/Settings.bundle/Root.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<array>
77
<dict>
88
<key>DefaultValue</key>
9-
<string>3.2.2 (2)</string>
9+
<string>3.2.2 (3)</string>
1010
<key>Key</key>
1111
<string>version_preference</string>
1212
<key>Title</key>

Shared/Resources/Settings.bundle/com.mono0926.LicensePlist.latest_result.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ name: ASN1Swift, nameSpecified: ASN1Swift, owner: tikhop, version: 1.2.4
22

33
name: DeepDiff, nameSpecified: DeepDiff, owner: onmyway133, version: 2.3.1
44

5-
name: Diagnostics, nameSpecified: Diagnostics, owner: WeTransfer, version:
5+
name: Diagnostics, nameSpecified: Diagnostics, owner: WeTransfer, version: 1.8.0
66

77
name: Down, nameSpecified: Down, owner: iwasrobbed, version: 0.9.4
88

99
name: GraphicsRenderer, nameSpecified: GraphicsRenderer, owner: shaps80, version: 1.4.4
1010

1111
name: Parma, nameSpecified: Parma, owner: dasautoooo, version: 0.2.0
1212

13-
name: sentry-cocoa, nameSpecified: Sentry, owner: getsentry, version: 5.2.2
13+
name: sentry-cocoa, nameSpecified: Sentry, owner: getsentry, version: 6.1.3
1414

1515
name: swift-log, nameSpecified: swift-log, owner: apple, version: 1.4.0
1616

1717
name: SwiftUIX, nameSpecified: SwiftUIX, owner: SwiftUIX, version:
1818

19-
name: TPInAppReceipt, nameSpecified: TPInAppReceipt, owner: tikhop, version: 3.0.2
19+
name: TPInAppReceipt, nameSpecified: TPInAppReceipt, owner: tikhop, version:
2020

2121
add-version-numbers: true
2222

Shared/Resources/Settings.bundle/com.mono0926.LicensePlist.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<key>File</key>
3131
<string>com.mono0926.LicensePlist/Diagnostics</string>
3232
<key>Title</key>
33-
<string>Diagnostics</string>
33+
<string>Diagnostics (1.8.0)</string>
3434
<key>Type</key>
3535
<string>PSChildPaneSpecifier</string>
3636
</dict>
@@ -62,7 +62,7 @@
6262
<key>File</key>
6363
<string>com.mono0926.LicensePlist/sentry-cocoa</string>
6464
<key>Title</key>
65-
<string>Sentry (5.2.2)</string>
65+
<string>Sentry (6.1.3)</string>
6666
<key>Type</key>
6767
<string>PSChildPaneSpecifier</string>
6868
</dict>
@@ -86,7 +86,7 @@
8686
<key>File</key>
8787
<string>com.mono0926.LicensePlist/TPInAppReceipt</string>
8888
<key>Title</key>
89-
<string>TPInAppReceipt (3.0.2)</string>
89+
<string>TPInAppReceipt</string>
9090
<key>Type</key>
9191
<string>PSChildPaneSpecifier</string>
9292
</dict>

0 commit comments

Comments
 (0)