Skip to content

Commit

Permalink
feat: add force-retry button
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2E committed Nov 6, 2023
1 parent 7ef870d commit b728981
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GitStatus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.rook1e.GitStatus;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -331,7 +331,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.rook1e.GitStatus;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
15 changes: 10 additions & 5 deletions GitStatus/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct ContentView: View {

var body: some View {
if runtimeData.lastPull != nil {
Text("Updated at: \(formatDate(runtimeData.lastPull))")
Text("Updated \(formatDate(runtimeData.lastPull))")
}

if runtimeData.message != "" {
Expand All @@ -35,10 +35,15 @@ struct ContentView: View {

Divider()

Button("Force Retry") {
runtimeData.renewPullTask(interval: runtimeData.interval)
}
Link(destination: URL(string: "https://github.com/notifications")!) {
Text("Raw Notifications")
Text("View in Broswer")
}


Divider()

// https://stackoverflow.com/questions/65355696/how-to-programatically-open-settings-preferences-window-in-a-macos-swiftui-app
if #available(macOS 14.0, *) {
SettingsLink(label: {
Expand All @@ -49,7 +54,7 @@ struct ContentView: View {
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
}
}
Button("Source Code"){
Button("Source Code") {
openURL(URL(string: "https://github.com/0x2E/GitStatus")!)
}

Expand All @@ -63,7 +68,7 @@ struct ContentView: View {

func formatDate(_ d: Date?) -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "MM-dd HH:mm:ss"
dateFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"

if let timestamp = d {
return dateFormatter.string(from: timestamp)
Expand Down

0 comments on commit b728981

Please sign in to comment.