Skip to content
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

Fix extensions enabling and update npx execution command #235

Merged
merged 1 commit into from
Oct 2, 2024
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
2 changes: 1 addition & 1 deletion bin/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (!isProduction) {
}

isProduction
? spawn('npx', ['codeclimbers', 'start', 'server'], {
? spawn('npx', ['codeclimbers@latest', 'start', 'server'], {
shell: true,
stdio: 'inherit',
})
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/services/extensions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ const extensions: (Extension | DashboardExtension)[] = [
},
]

function getActiveExtensionIds() {
function getActiveExtensionIds(): string[] {
const rawExtensions = localStorage.getItem(EXTENSIONS_KEY)
const extensionIds = rawExtensions
? (JSON.parse(rawExtensions) as string[])
: []
return extensionIds
}

function getActiveExtensions() {
function getActiveExtensions(): Extension[] {
const extensionIds = getActiveExtensionIds()
const activeExtensions = extensionIds.map((id) =>
extensions.find((extension) => extension.id === id),
Expand Down Expand Up @@ -96,7 +96,7 @@ function isExtensionAdded(extensionId: string) {

function addExtension(extensionId: string) {
if (!extensionId) return
const extensions = getActiveExtensions()
const extensions = getActiveExtensionIds()
if (isExtensionAdded(extensionId)) {
return // already activated, don't add again
}
Expand Down
Loading