Skip to content

Commit

Permalink
Save Config & Session on quit. Lib: Fix error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
melgu committed Jun 7, 2020
1 parent e4c55d3 commit b38c580
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TidalSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 23;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_ASSET_PATHS = "TidalSwift/Preview\\ Content";
DEVELOPMENT_TEAM = V7E5P7292M;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -1052,7 +1052,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 23;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_ASSET_PATHS = "TidalSwift/Preview\\ Content";
DEVELOPMENT_TEAM = V7E5P7292M;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down
5 changes: 4 additions & 1 deletion TidalSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
var offlineTrackSortingCancellable: AnyCancellable?
var offlineTrackReversedCancellable: AnyCancellable?

// MARK: - Functions

override init() {
let session = Session(config: nil)
Expand Down Expand Up @@ -368,6 +369,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

func saveState() {
sc.session.saveConfig()
sc.session.saveSession()
savePlaybackState()
saveViewState()
saveViewCache()
Expand Down Expand Up @@ -538,7 +541,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
NSApp.terminate(nil)
}

// MARK: File
// MARK: - File

@IBAction func downloadTrack(_ sender: Any) {
print("Menu: downloadTrack")
Expand Down
2 changes: 1 addition & 1 deletion TidalSwiftLib/Logic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public class Session {
let imageSizeString = persistentInformation["imageSize"],
let imageSize = Int(imageSizeString)
else {
displayError(title: "Couldn't load Config", content: "Missing part of Persistent Config")
displayError(title: "Couldn't load Config", content: "Missing part of Persistent Config.")
return nil
}

Expand Down

0 comments on commit b38c580

Please sign in to comment.