Skip to content

Commit

Permalink
Removed duplicate code errors from rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
kintsoogi committed Sep 27, 2023
1 parent 43e2fcd commit 11a08cb
Show file tree
Hide file tree
Showing 3 changed files with 397 additions and 53 deletions.
21 changes: 1 addition & 20 deletions src/components/ResourceCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ export default function ResourceCard({
}
const [content, setContent] = useState('')
const [saved, setSaved] = useState(true)
const [fetchConfig, setFetchConfig] = useState({
basicReference,
config: HTTP_CONFIG,
readyToFetch: false,
})
const [isSaving, setIsSaving] = useState(false)
const [fetchConfig, setFetchConfig] = useState({
basicReference,
Expand Down Expand Up @@ -136,18 +131,6 @@ export default function ResourceCard({
useUserLocalStorage,
})

useEffect(() => {
if (cardResourceId) {
updateMergeState(
cardResourceId,
mergeFromMaster,
mergeToMaster,
mergeFromMasterIntoUserBranch,
mergeToMasterFromUserBranch,
)
}
},[cardResourceId, mergeFromMaster, mergeToMaster])

// update fetch configuration if changed
useEffect(() => {
const config = usingUserBranch ? RESOURCE_HTTP_CONFIG : HTTP_CONFIG
Expand Down Expand Up @@ -470,11 +453,9 @@ export default function ResourceCard({
selectedQuote={selectedQuote}
setContent={setContent}
setCurrentCheck={setCurrentCheck}
showSaveChangesPrompt={showSaveChangesPrompt}
updateTaDetails={updateTaDetails}
viewMode={viewMode}
showSaveChangesPrompt={showSaveChangesPrompt}
errorMessage={isEditing ? 'Saving Resource...' : message || errorMessage}
markdown={(cardResourceId == 'ta' || cardResourceId == 'tw') && content.length > 0 ? content : markdown}// Adding content value to maintain edit changes even when switching between markdown and html views on tA.
/>
</Card>
)
Expand Down
5 changes: 0 additions & 5 deletions src/components/WorkspaceContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,7 @@ function WorkspaceContainer() {
ref: appRef,
},
resourceLink: origResourceLink,
config: {
...config,
server: origServer,
},
wholeBook: true,
readyForFetch: !!bookId,
})

useEffect(() => {
Expand Down
Loading

0 comments on commit 11a08cb

Please sign in to comment.