Skip to content

Commit

Permalink
Merge pull request #631 from nyaggah/feat/first-run
Browse files Browse the repository at this point in the history
feat(cli): if else instead of ternary
  • Loading branch information
JoeyDoey authored Dec 10, 2024
2 parents 1ab3c0e + b8be7c0 commit ddac0c4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/great-rules-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'overlay-react-ts': patch
'@bedframe/cli': patch
---

in/else instead of ternary
6 changes: 5 additions & 1 deletion examples/overlay-react-ts/src/scripts/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export const frameConfig: FrameConfig = {

export function mountOrUnmountIframe(): void {
const FrameId = (frameConfig.iframe as { id: string }).id
document.getElementById(FrameId) === null ? mountFrame() : unmountIframe()
if (document.getElementById(FrameId) === null) {
mountFrame()
} else {
unmountIframe()
}
}

export function openOrCloseExtension(): void {
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/public/stubs/scripts/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export const frameConfig: FrameConfig = {

export function mountOrUnmountIframe(): void {
const FrameId = (frameConfig.iframe as { id: string }).id
document.getElementById(FrameId) === null ? mountFrame() : unmountIframe()
if (document.getElementById(FrameId) === null) {
mountFrame()
} else {
unmountIframe()
}
}

export function openOrCloseExtension(): void {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/make/utils/write-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function writePackageJson(response: prompts.Answers<string>): void {
}
},
"devDependencies": {
"@bedframe/cli": "0.0.89",
"@bedframe/cli": "0.0.90",
"@bedframe/core": "0.0.44",
${
changesets
Expand Down

0 comments on commit ddac0c4

Please sign in to comment.