Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Reset all settings not resetting all settings #152

Merged
merged 2 commits into from Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions PlayCover/Model/AppSettings.swift
Expand Up @@ -230,10 +230,8 @@ class AppSettings {
}

func reset() {
adaptiveDisplay = info.isGame
keymapping = info.isGame
disableTimeout = false
layout = []
allPrefs.removeValue(forKey: info.bundleIdentifier)
createSettingsIfNotExists()
}

init(_ info: AppInfo, container: AppContainer?) {
Expand Down
3 changes: 3 additions & 0 deletions PlayCover/View/AppSettingsView.swift
Expand Up @@ -106,6 +106,9 @@ struct AppSettingsView: View {
Button("settings.reset") {
resetCompletedAlert.toggle()
settings.reset()
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
presentationMode.wrappedValue.dismiss()
}
}.controlSize(.large).padding()
Button("button.OK") {
settings.keymapping = keymapping
Expand Down