Skip to content

Commit db3facd

Browse files
author
Ernest Fan
authored
Merge pull request #1620 from NYPL-Simplified/release/simplye/3.9.3
Merge SE 3.9.3 Release to Master
2 parents 7cae8e4 + e718519 commit db3facd

56 files changed

Lines changed: 852 additions & 528 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Axis-iOS

NYPLAEToolkit

Simplified.xcodeproj/project.pbxproj

Lines changed: 59 additions & 24 deletions
Large diffs are not rendered by default.

Simplified/Accounts/Library/Account.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ class OPDS2SamlIDP: NSObject, Codable {
2727
func isSignedIn() -> Bool
2828
}
2929

30+
@objc protocol NYPLReaderServerPermissions {
31+
var syncPermissionGranted:Bool {get}
32+
}
33+
3034
// MARK: AccountDetails
3135
// Extra data that gets loaded from an OPDS2AuthenticationDocument,
32-
@objcMembers final class AccountDetails: NSObject {
36+
@objcMembers final class AccountDetails: NSObject, NYPLReaderServerPermissions {
3337
enum AuthType: String, Codable {
3438
/// This is used with barcode/username credentials on SimplyE. It was also
3539
/// used for FirstBook authentication on Open eBooks versions before 2.4.0.

Simplified/Accounts/Library/AccountsManager.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,9 @@ let currentAccountIdentifierKey = "NYPLCurrentAccountIdentifier"
348348
}
349349
}
350350
}
351+
352+
extension AccountsManager: NYPLReaderServerPermissions {
353+
var syncPermissionGranted: Bool {
354+
return currentAccount?.details?.syncPermissionGranted ?? false
355+
}
356+
}

Simplified/Accounts/User/NYPLUserAccount.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private enum StorageKey: String {
4141
static func sharedAccount(libraryUUID: String?) -> NYPLUserAccount
4242
}
4343

44-
@objc protocol NYPLOAuthTokenProvider {
44+
@objc protocol NYPLOAuthTokenSource {
4545
var authToken: String? { get }
4646
func setAuthToken(_ token: String)
4747
func hasOAuthClientCredentials() -> Bool
@@ -58,7 +58,7 @@ private enum StorageKey: String {
5858
/// by storing credentials on the keychain using storage keys that contain the
5959
/// the library UUID appended after the actual key name.
6060
/// - seealso: StorageKey.keyForLibrary(uuid:)
61-
@objcMembers class NYPLUserAccount : NSObject, NYPLUserAccountProvider, NYPLOAuthTokenProvider {
61+
@objcMembers class NYPLUserAccount : NSObject, NYPLUserAccountProvider, NYPLOAuthTokenSource {
6262
static private let shared = NYPLUserAccount()
6363

6464
private let accountInfoLock = NSRecursiveLock()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// NYPLRootTabBarController+Common.swift
3+
// Simplified
4+
//
5+
// Created by Ettore Pasquini on 11/9/22.
6+
// Copyright © 2022 NYPL. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
extension NYPLRootTabBarController {
12+
@objc func makeR2Owner() -> NYPLR2Owner {
13+
self.annotationsSynchronizer = NYPLAnnotations()
14+
return NYPLR2Owner(bookRegistry: NYPLBookRegistry.shared(),
15+
annotationsSynchronizer: annotationsSynchronizer)
16+
}
17+
}

Simplified/AppInfrastructure/NYPLRootTabBarController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@class NYPLR2Owner;
2+
@class NYPLAnnotations;
23
@class NYPLCatalogNavigationController;
34

45
@interface NYPLRootTabBarController : UITabBarController
@@ -11,6 +12,7 @@
1112
+ (instancetype)sharedController;
1213

1314
@property (readonly) NYPLR2Owner *r2Owner;
15+
@property NYPLAnnotations *annotationsSynchronizer;
1416
@property(nonatomic, readonly) NYPLCatalogNavigationController *catalogNavigationController;
1517

1618
/// This method will present a view controller from the receiver, or from the

Simplified/AppInfrastructure/NYPLRootTabBarController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ - (instancetype)init
5959
selector:@selector(setTabViewControllers)
6060
name:NSNotification.NYPLCurrentAccountDidChange
6161
object:nil];
62-
63-
self.r2Owner = [[NYPLR2Owner alloc] init];
62+
self.r2Owner = [self makeR2Owner];
6463
return self;
6564
}
6665

0 commit comments

Comments
 (0)