Skip to content

Commit

Permalink
feat: change add default app shortcut place
Browse files Browse the repository at this point in the history
  • Loading branch information
AkaShark committed Feb 4, 2024
1 parent 0b577f4 commit f9c9229
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
8 changes: 8 additions & 0 deletions Easydict/NewApp/Feature/Shortcut/Shortcut.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ class Shortcut: NSObject {
@objc static func setupShortcut() {
let shortcut = Shortcut.shared
shortcut.restoreShortcut()

if Defaults[.firstLaunch] {
Defaults[.firstLaunch] = false
// set defalut for app shortcut
shortcut.setDefaultForAppShortcut()
} else {
// do nothing
}
}

// Make sure the class has only one instance
Expand Down
13 changes: 0 additions & 13 deletions Easydict/NewApp/View/SettingView/Tabs/ShortcutTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ struct ShortcutTab: View {
AppShortcutSettingView()
}
.formStyle(.grouped)
.onAppear {
setDefaultAppShortcut()
}
}

func setDefaultAppShortcut() {
if Defaults[.firstLaunch] {
Defaults[.firstLaunch] = false
// set defalut for app shortcut
Shortcut.shared.setDefaultForAppShortcut()
} else {
// do nothing
}
}
}

Expand Down

0 comments on commit f9c9229

Please sign in to comment.