Skip to content

[tvOS] Apple TV warning should only happen once #1021

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

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/default-storage-backend/ios/RNCAsyncStorage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ static void RCTAppendError(NSDictionary *error, NSMutableArray<NSDictionary *> *
static NSString *storageDirectory = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
#if TARGET_OS_TV
RCTLogWarn(
@"Persistent storage is not supported on tvOS, your data may be removed at any point.");
#endif
storageDirectory = RCTCreateStorageDirectoryPath(RCTStorageDirectory);
});
return storageDirectory;
Expand Down Expand Up @@ -499,11 +503,6 @@ - (NSDictionary *)_ensureSetup
{
RCTAssertThread(RCTGetMethodQueue(), @"Must be executed on storage thread");

#if TARGET_OS_TV
RCTLogWarn(
@"Persistent storage is not supported on tvOS, your data may be removed at any point.");
#endif

NSError *error = nil;
if (!RCTHasCreatedStorageDirectory) {
_createStorageDirectory(RCTGetStorageDirectory(), &error);
Expand Down