Skip to content

Commit

Permalink
Defer the creation of a holds notification state until we have a need
Browse files Browse the repository at this point in the history
to persist that knowledge beyond a single sync session.
  • Loading branch information
gioneill committed Jan 8, 2019
1 parent 2f2aa2b commit dc57329
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 76 deletions.
8 changes: 0 additions & 8 deletions Simplified.xcodeproj/project.pbxproj
Expand Up @@ -143,7 +143,6 @@
2DEF10BA201ECCEA0082843A /* NYPLMyBooksSimplifiedBearerToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DEF10B9201ECCEA0082843A /* NYPLMyBooksSimplifiedBearerToken.m */; };
2DF321831DC3B83500E1858F /* NYPLAnnotations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DF321821DC3B83500E1858F /* NYPLAnnotations.swift */; };
2DFAC8ED1CD8DDD1003D9EC0 /* NYPLOPDSCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DFAC8EC1CD8DDD1003D9EC0 /* NYPLOPDSCategory.m */; };
524DAD78219F652500F4C808 /* NYPLHoldsNotificationState.m in Sources */ = {isa = PBXBuildFile; fileRef = 524DAD77219F652500F4C808 /* NYPLHoldsNotificationState.m */; };
52545185217A76FF00BBC1B4 /* NYPLUserNotifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52545184217A76FF00BBC1B4 /* NYPLUserNotifications.swift */; };
52592BB821220A1100587288 /* NYPLLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = 52592BB721220A1100587288 /* NYPLLocalization.m */; };
5A5B901B1B946FAD002C53E9 /* NYPLReaderContainerDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5A5B901A1B946FAD002C53E9 /* NYPLReaderContainerDelegate.mm */; };
Expand Down Expand Up @@ -175,7 +174,6 @@
A823D823192BABA400B55DE2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A823D822192BABA400B55DE2 /* Images.xcassets */; };
A92FB0F921CDCE3D004740F4 /* NYPLReturnPromptHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92FB0F821CDCE3D004740F4 /* NYPLReturnPromptHelper.swift */; };
A93F9F9721CDACF700BD3B0C /* NYPLAppReviewPrompt.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93F9F9621CDACF700BD3B0C /* NYPLAppReviewPrompt.swift */; };
A9580CA821D5BF3B00BD2CF4 /* NYPLUserNotificationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9580CA721D5BF3B00BD2CF4 /* NYPLUserNotificationDelegate.swift */; };
AE77E7E37D89FB3EED630624 /* NYPLOPDSType.m in Sources */ = {isa = PBXBuildFile; fileRef = AE77EFD5622206475B6715A9 /* NYPLOPDSType.m */; };
AE77E9B832371587493FF281 /* NYPLOPDSEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = AE77E4AF64208439F78B3D73 /* NYPLOPDSEntry.m */; };
AE77EB0CB5B94AEC591E2D91 /* NYPLOPDSLink.m in Sources */ = {isa = PBXBuildFile; fileRef = AE77ECC029F3DABDB46A64EB /* NYPLOPDSLink.m */; };
Expand Down Expand Up @@ -490,8 +488,6 @@
2DF321821DC3B83500E1858F /* NYPLAnnotations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NYPLAnnotations.swift; sourceTree = "<group>"; };
2DFAC8EB1CD8DDD1003D9EC0 /* NYPLOPDSCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLOPDSCategory.h; sourceTree = "<group>"; };
2DFAC8EC1CD8DDD1003D9EC0 /* NYPLOPDSCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYPLOPDSCategory.m; sourceTree = "<group>"; };
524DAD72219F628700F4C808 /* NYPLHoldsNotificationState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NYPLHoldsNotificationState.h; sourceTree = "<group>"; };
524DAD77219F652500F4C808 /* NYPLHoldsNotificationState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NYPLHoldsNotificationState.m; sourceTree = "<group>"; };
52545184217A76FF00BBC1B4 /* NYPLUserNotifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLUserNotifications.swift; sourceTree = "<group>"; };
52592BB721220A1100587288 /* NYPLLocalization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NYPLLocalization.m; sourceTree = "<group>"; };
52592BBB21220A4F00587288 /* NYPLLocalization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NYPLLocalization.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -542,7 +538,6 @@
A823D833192BABA400B55DE2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A92FB0F821CDCE3D004740F4 /* NYPLReturnPromptHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLReturnPromptHelper.swift; sourceTree = "<group>"; };
A93F9F9621CDACF700BD3B0C /* NYPLAppReviewPrompt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLAppReviewPrompt.swift; sourceTree = "<group>"; };
A9580CA721D5BF3B00BD2CF4 /* NYPLUserNotificationDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLUserNotificationDelegate.swift; sourceTree = "<group>"; };
AE77E0F3FB181D0C1529C865 /* NYPLOPDSLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLOPDSLink.h; sourceTree = "<group>"; };
AE77E304AA30ABF2921B6393 /* NYPLOPDSFeed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLOPDSFeed.h; sourceTree = "<group>"; };
AE77E4AF64208439F78B3D73 /* NYPLOPDSEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYPLOPDSEntry.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -900,8 +895,6 @@
11C5DCF31976D22F005A9945 /* NYPLHoldsViewController.h */,
11C5DCF41976D22F005A9945 /* NYPLHoldsViewController.m */,
52545184217A76FF00BBC1B4 /* NYPLUserNotifications.swift */,
524DAD72219F628700F4C808 /* NYPLHoldsNotificationState.h */,
524DAD77219F652500F4C808 /* NYPLHoldsNotificationState.m */,
);
name = Holds;
sourceTree = "<group>";
Expand Down Expand Up @@ -1464,7 +1457,6 @@
2DC8D9DC1D09F797007DD125 /* UpdateCheck.swift in Sources */,
11BFDB33199C01F700378691 /* NYPLReaderTOCViewController.m in Sources */,
2D62568B1D412BCB0080A81F /* BundledHTMLViewController.swift in Sources */,
524DAD78219F652500F4C808 /* NYPLHoldsNotificationState.m in Sources */,
110AF8961961D94D004887C3 /* NYPLBookDetailView.m in Sources */,
0813875A1BC5767F003DEA6A /* UIButton+NYPLAppearanceAdditions.m in Sources */,
1139DA6519C7755D00A07810 /* NYPLBookCoverRegistry.m in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions Simplified/NYPLAppDelegate.m
Expand Up @@ -61,7 +61,7 @@ - (BOOL)application:(__attribute__((unused)) UIApplication *)application
// Initialize Offline Requests Queue
[NetworkQueue shared];
self.reachabilityManager = [NYPLReachability sharedReachability];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.tintColor = [NYPLConfiguration mainColor];
self.window.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
Expand All @@ -71,7 +71,7 @@ - (BOOL)application:(__attribute__((unused)) UIApplication *)application
self.window.rootViewController = vc;

[self beginCheckingForUpdates];

return YES;
}

Expand Down
3 changes: 0 additions & 3 deletions Simplified/NYPLBookDetailButtonsView.m
Expand Up @@ -390,9 +390,6 @@ - (void)didSelectRead

- (void)didSelectDownload
{
if (self.state == NYPLBookButtonsStateCanHold) {
// [NYPLHoldsNotifications verifyAuthorization];
}
self.activityIndicator.center = self.downloadButton.center;
[self.delegate didSelectDownloadForBook:self.book];
}
Expand Down
2 changes: 0 additions & 2 deletions Simplified/NYPLCatalogNavigationController.m
Expand Up @@ -177,7 +177,6 @@ - (void)viewDidLoad
[super viewDidLoad];
NYPLSettings *settings = [NYPLSettings sharedSettings];
if (settings.userHasSeenWelcomeScreen == YES) {
NYPLLOG(@"RELOAD FROM CATALOG IS BEING RUN");
Account *account = [[AccountsManager sharedInstance] currentAccount];
[[NYPLSettings sharedSettings] setAccountMainFeedURL:[NSURL URLWithString:account.catalogUrl]];
[UIApplication sharedApplication].delegate.window.tintColor = [NYPLConfiguration mainColor];
Expand Down Expand Up @@ -212,7 +211,6 @@ - (void)viewDidAppear:(BOOL)animated

if (settings.acceptedEULABeforeMultiLibrary == NO) {
NYPLWelcomeScreenViewController *welcomeScreenVC = [[NYPLWelcomeScreenViewController alloc] initWithCompletion:^(Account *const account) {

[[NYPLBookRegistry sharedRegistry] save];
[AccountsManager shared].currentAccount = account;
[self reloadSelectedLibraryAccount];
Expand Down
19 changes: 0 additions & 19 deletions Simplified/NYPLHoldsNotificationState.h

This file was deleted.

42 changes: 0 additions & 42 deletions Simplified/NYPLHoldsNotificationState.m

This file was deleted.

0 comments on commit dc57329

Please sign in to comment.