Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 2 additions & 11 deletions ios/Fabric/NutrientView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
_view.componentID = [self.nativeId integerValue];

auto newProps = std::static_pointer_cast<const NutrientViewProps>(props);
auto oldViewProps = std::static_pointer_cast<const NutrientViewProps>(oldProps);
if (newProps != nullptr) {
// Parse configuration first so remoteDocumentConfiguration is available when applying document
NSDictionary *jsonConfig = nil;
Expand All @@ -328,16 +327,8 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
jsonConfig = [NutrientFabricUtils dictionaryFromJSONString:_configurationJSONString];
}

// Basic document props.
//
// Only (re)apply the document when the path actually changes. Fabric calls
// updateProps with the full prop set on every re-render, so applying the
// document unconditionally here would create a fresh PSPDFDocument and
// reload the controller on *any* prop change (e.g. a dynamic
// menuItemGrouping driven by React state), discarding unsaved in-memory
// annotations. Mirrors the document-identity guard used on Android.
BOOL documentChanged = (oldViewProps == nullptr) || (newProps->document != oldViewProps->document);
if (!newProps->document.empty() && documentChanged) {
// Basic document props
if (!newProps->document.empty()) {
_document = RCTNSStringFromString(newProps->document);
NSNumber *reference = [NSNumber numberWithInteger:[self.nativeId integerValue]];
NSDictionary *remoteConfig = jsonConfig[@"remoteDocumentConfiguration"];
Expand Down
5 changes: 0 additions & 5 deletions samples/Catalog/Catalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { ManualSave } from './examples/ManualSave';
import Measurement from './examples/Measurement';
import { OpenImageDocument } from './examples/OpenImageDocument';
import { ProgrammaticAnnotations } from './examples/ProgrammaticAnnotations';
import { SwitchAnnotationTools } from './examples/SwitchAnnotationTools';
import { ProgrammaticFormFilling } from './examples/ProgrammaticFormFilling';
import { NutrientViewComponent } from './examples/NutrientViewComponent';
import { SaveAs } from './examples/SaveAs';
Expand Down Expand Up @@ -84,10 +83,6 @@ class Catalog extends React.Component {
component={OpenRemoteDocument}
/>
<Stack.Screen name="ManualSave" component={ManualSave} />
<Stack.Screen
name="SwitchAnnotationTools"
component={SwitchAnnotationTools}
/>
<Stack.Screen name="SaveAs" component={SaveAs} />
<Stack.Screen name="EventListeners" component={EventListeners} />
<Stack.Screen name="StateChange" component={StateChange} />
Expand Down
11 changes: 0 additions & 11 deletions samples/Catalog/ExamplesNavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,6 @@ export default [
title: 'AI Assistant',
});
},
},
{
key: 'item26',
name: 'Switch Annotation Tools',
description:
'Switch between annotation creation tools without losing unsaved annotations. Toggle to compare a dynamic vs. static menuItemGrouping.',
action: (component: any) => {
extractFromAssetsIfMissing(exampleDocumentName, function () {
component.props.navigation.push('SwitchAnnotationTools');
});
},
}
];

Expand Down
171 changes: 0 additions & 171 deletions samples/Catalog/examples/SwitchAnnotationTools.tsx

This file was deleted.