Skip to content

Commit b3a75bf

Browse files
refactor: remove code paths related to component and style editors.
1 parent 5b7ab88 commit b3a75bf

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

src/app.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,8 @@ const getWorkspacePrFileCommits = () =>
585585

586586
const getEditorSyncTargets = () => workspaceSyncController.getEditorSyncTargets()
587587

588-
const reconcileWorkspaceTabsWithEditorSync = ({ componentPath, stylesPath } = {}) =>
589-
workspaceSyncController.reconcileWorkspaceTabsWithEditorSync({
590-
componentPath,
591-
stylesPath,
592-
})
588+
const reconcileWorkspaceTabsWithEditorSync = ({ tabTargets } = {}) =>
589+
workspaceSyncController.reconcileWorkspaceTabsWithEditorSync({ tabTargets })
593590

594591
const buildWorkspaceRecordSnapshot = ({ recordId } = {}) =>
595592
workspaceSyncController.buildWorkspaceRecordSnapshot({ recordId })

src/modules/github/github-pr-editor-sync.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export const createGitHubPrEditorSyncController = ({
2525
const tabTargets = Array.isArray(syncTargets?.tabTargets)
2626
? syncTargets.tabTargets
2727
: []
28-
const componentPath = toSafeText(
28+
const componentTabPath = toSafeText(
2929
tabTargets.find(target => toSafeText(target?.kind) === 'component')?.path,
3030
)
31-
const stylesPath = toSafeText(
31+
const stylesTabPath = toSafeText(
3232
tabTargets.find(target => toSafeText(target?.kind) === 'styles')?.path,
3333
)
3434

35-
if (!token || !owner || !repo || !branch || !componentPath || !stylesPath) {
35+
if (!token || !owner || !repo || !branch || !componentTabPath || !stylesTabPath) {
3636
return {
3737
synced: false,
3838
componentSynced: false,
@@ -44,19 +44,19 @@ export const createGitHubPrEditorSyncController = ({
4444
token,
4545
owner,
4646
repo,
47-
path: componentPath,
47+
path: componentTabPath,
4848
ref: branch,
4949
signal,
5050
})
5151

5252
const stylesRequest =
53-
stylesPath === componentPath
53+
stylesTabPath === componentTabPath
5454
? componentRequest
5555
: getRepositoryFileContent({
5656
token,
5757
owner,
5858
repo,
59-
path: stylesPath,
59+
path: stylesTabPath,
6060
ref: branch,
6161
signal,
6262
})
@@ -90,7 +90,7 @@ export const createGitHubPrEditorSyncController = ({
9090
stylesSynced = true
9191
}
9292

93-
if (stylesPath === componentPath) {
93+
if (stylesTabPath === componentTabPath) {
9494
stylesSynced = componentSynced
9595
}
9696

0 commit comments

Comments
 (0)