Skip to content

Commit

Permalink
✨ More bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsonwheels committed Mar 2, 2023
1 parent 9c0786a commit f539b96
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 17 deletions.
1 change: 0 additions & 1 deletion App/Views/Modifiers/OpenURLModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ struct OpenURLModifier: ViewModifier {
switch url.pathComponents[safe: 2] {
case "images":
if let id = url.pathComponents[safe: 3] {
print(id)
Task {
do {
let image = try await self.globalViewModel.getImagePublicMetadata(id: id)
Expand Down
23 changes: 21 additions & 2 deletions App/Views/Settings/MaintainanceSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,46 @@ import WidgetKit
import Nuke

struct MaintainanceSettingsView: View {
@EnvironmentObject private var globalViewModel: GlobalViewModel

@AppStorage("hasPresentedWelcome") private var hasPresentedWelcome: Bool = false

@State private var isForgetAlertPresented = false

private func clearNukeCache() {
ImagePipeline.shared.cache.removeAll()
}

private func forgetEverything() {
self.clearNukeCache()
UserDefaults.standard.removePersistentDomain(forName: "me.jkelol111.Iamages")
UserDefaults.standard.removePersistentDomain(forName: "group.me.jkelol111.Iamages")
UserDefaults.standard.synchronize()
try? self.globalViewModel.logout()
}

var body: some View {
Section {
Section("Non-destructive") {
Button("Force widget refresh") {
WidgetCenter.shared.reloadAllTimelines()
}
Button("Clear image cache", action: self.clearNukeCache)
Button("Show welcome sheet on next launch") {
self.hasPresentedWelcome = false
}
.disabled(!self.hasPresentedWelcome)
}
Section {
Button("Clear image cache", role: .destructive, action: self.clearNukeCache)
Button("Forget everything", role: .destructive) {
self.isForgetAlertPresented = true
}
.confirmationDialog("Forget everything?", isPresented: self.$isForgetAlertPresented, titleVisibility: .visible) {
Button("Forget", role: .destructive, action: self.forgetEverything)
} message: {
Text("Everything will be reset to defaults!\nYou will have to log in again.")
}
} header: {
Text("Destructive")
} footer: {
Text("Use these options only if something seems off, Iamages can take care of itself!")
}
Expand Down
24 changes: 12 additions & 12 deletions Iamages.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 31;
DEVELOPMENT_TEAM = 2VZNUT7D2E;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Widgets/Info.plist;
Expand All @@ -1017,7 +1017,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.1.1;
MARKETING_VERSION = 4.1.2;
PRODUCT_BUNDLE_IDENTIFIER = me.jkelol111.Iamages.Widgets;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand All @@ -1039,7 +1039,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 31;
DEVELOPMENT_TEAM = 2VZNUT7D2E;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Widgets/Info.plist;
Expand All @@ -1051,7 +1051,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.1.1;
MARKETING_VERSION = 4.1.2;
PRODUCT_BUNDLE_IDENTIFIER = me.jkelol111.Iamages.Widgets;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand All @@ -1072,7 +1072,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 31;
DEVELOPMENT_TEAM = 2VZNUT7D2E;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ShareExtension/Info.plist;
Expand All @@ -1084,7 +1084,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.1.1;
MARKETING_VERSION = 4.1.2;
PRODUCT_BUNDLE_IDENTIFIER = me.jkelol111.Iamages.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand All @@ -1104,7 +1104,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 31;
DEVELOPMENT_TEAM = 2VZNUT7D2E;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ShareExtension/Info.plist;
Expand All @@ -1116,7 +1116,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.1.1;
MARKETING_VERSION = 4.1.2;
PRODUCT_BUNDLE_IDENTIFIER = me.jkelol111.Iamages.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1251,7 +1251,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 31;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"App/Preview Content\"";
DEVELOPMENT_TEAM = 2VZNUT7D2E;
Expand All @@ -1277,7 +1277,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 4.1.1;
MARKETING_VERSION = 4.1.2;
PRODUCT_BUNDLE_IDENTIFIER = me.jkelol111.Iamages;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
Expand All @@ -1301,7 +1301,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 31;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"App/Preview Content\"";
DEVELOPMENT_TEAM = 2VZNUT7D2E;
Expand All @@ -1327,7 +1327,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 4.1.1;
MARKETING_VERSION = 4.1.2;
PRODUCT_BUNDLE_IDENTIFIER = me.jkelol111.Iamages;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
Expand Down
3 changes: 2 additions & 1 deletion ShareExtension/ShareView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct ShareView: View {
}

private func upload() async {
self.focusedField = nil
await self.uploadModel.upload()
if self.uploadModel.error == nil {
self.dismiss()
Expand Down Expand Up @@ -97,7 +98,7 @@ struct ShareView: View {
self.dismiss()
}
} message: {
Text("This image will not be uploaded")
Text("This image will not be uploaded.")
}
}
ToolbarItem(placement: .primaryAction) {
Expand Down
2 changes: 1 addition & 1 deletion Widgets/Views/ImageWidgetEntryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct ImageWidgetEntryView : View {
.fill(.orange.gradient)
}
}
.widgetURL(URL(string: "iamages://api/images/\(self.entry.id ?? "")/embed"))
.widgetURL(URL(string: "iamages://open/api/images/\(self.entry.id ?? "")/embed"))
}
}

Expand Down

0 comments on commit f539b96

Please sign in to comment.