Skip to content

Commit

Permalink
Merge branch 'develop' into listen-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Apr 14, 2023
2 parents 1db7a1d + 0636ec3 commit ae2881f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 7 additions & 0 deletions PocketKit/Sources/SaveToPocketKit/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ class MainViewController: UIViewController {
let appSession = services.appSession
let encryptedStore = PocketEncryptedStore()
let userDefaults = services.userDefaults
let user = services.user
let child: UIViewController

SignOutOnFirstLaunch(
appSession: appSession,
user: user,
userDefaults: userDefaults
).signOutOnFirstLaunch()

let legacyUserMigration = LegacyUserMigration(
userDefaults: userDefaults,
encryptedStore: encryptedStore,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import Foundation
import Sync
import SharedPocketKit

class SignOutOnFirstLaunch {
public class SignOutOnFirstLaunch {
static let hasAppBeenLaunchedPreviouslyKey = UserDefaults.Key.hasAppBeenLaunchedPreviously

private let appSession: AppSession
private let user: User
private let userDefaults: UserDefaults

init(
public init(
appSession: AppSession,
user: User,
userDefaults: UserDefaults
Expand All @@ -19,7 +17,7 @@ class SignOutOnFirstLaunch {
self.userDefaults = userDefaults
}

var hasAppBeenLaunchedPreviously: Bool {
private var hasAppBeenLaunchedPreviously: Bool {
get {
userDefaults.bool(forKey: Self.hasAppBeenLaunchedPreviouslyKey)
}
Expand All @@ -28,7 +26,7 @@ class SignOutOnFirstLaunch {
}
}

func signOutOnFirstLaunch() {
public func signOutOnFirstLaunch() {
guard !hasAppBeenLaunchedPreviously else {
return
}
Expand Down

0 comments on commit ae2881f

Please sign in to comment.