Skip to content

Commit c73b27f

Browse files
committed
fix: terminal link for dev mode
1 parent 1c4e081 commit c73b27f

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

components/LeftSidebar.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const appStore = useAppStore()
2020
const nodeStore = useNodeStore()
2121
const modalsStore = useModalsStore()
2222
23+
const developerMode = useCookie("developerMode", { default: () => false })
24+
2325
const head = computed(() => appStore.lastHead)
2426
2527
const mainLinks = reactive([
@@ -94,7 +96,7 @@ const mainLinks = reactive([
9496
{
9597
name: "Ecosystem",
9698
path: "/stats?tab=ecosystem",
97-
queryParam: {tab: "ecosystem"},
99+
queryParam: { tab: "ecosystem" },
98100
show: isMainnet(),
99101
},
100102
],
@@ -148,6 +150,7 @@ const toolsLinks = reactive([
148150
path: "https://terminal.celenium.io",
149151
external: true,
150152
new: true,
153+
hide: !developerMode.value,
151154
},
152155
{
153156
icon: "drop",
@@ -178,6 +181,15 @@ const toolsLinks = reactive([
178181
},
179182
])
180183
184+
/** TEMP */
185+
watch(
186+
() => developerMode.value,
187+
() => {
188+
const terminalLinkIdx = toolsLinks.findIndex((l) => l.name === "Terminal")
189+
toolsLinks[terminalLinkIdx].hide = !developerMode.value
190+
},
191+
)
192+
181193
const handleNavigate = (url) => {
182194
window.location.replace(url)
183195
}
@@ -216,7 +228,7 @@ const handleOnClose = () => {
216228
</Flex>
217229

218230
<Flex direction="column" gap="2">
219-
<NavLink v-for="link in mainLinks" :link="link" @onClose="handleOnClose" />
231+
<NavLink v-for="link in mainLinks.filter((l) => !l.hide)" :link="link" @onClose="handleOnClose" />
220232
</Flex>
221233

222234
<Flex direction="column" gap="2">
@@ -231,7 +243,7 @@ const handleOnClose = () => {
231243
</Flex>
232244

233245
<Flex v-if="!isModularLinksCollapsed" direction="column" gap="2">
234-
<NavLink v-for="link in modularLinks" :link="link" @onClose="handleOnClose" />
246+
<NavLink v-for="link in modularLinks.filter((l) => !l.hide)" :link="link" @onClose="handleOnClose" />
235247
</Flex>
236248
</Flex>
237249

@@ -247,7 +259,7 @@ const handleOnClose = () => {
247259
</Flex>
248260

249261
<Flex v-if="!isToolsLinkCollapsed" direction="column" gap="2">
250-
<NavLink v-for="link in toolsLinks" :link="link" @onClose="handleOnClose" />
262+
<NavLink v-for="link in toolsLinks.filter((l) => !l.hide)" :link="link" @onClose="handleOnClose" />
251263
</Flex>
252264
</Flex>
253265

components/cmd/CommandMenu.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const notificationsStore = useNotificationsStore()
3838
3939
const appConfig = useAppConfig()
4040
41+
const developerMode = useCookie("developerMode", { default: () => false })
4142
const theme = useCookie("theme", { default: () => "dark" })
4243
const showPromoBackground = useCookie("showPromoBackground", { default: () => true })
4344
@@ -60,7 +61,6 @@ const searchTerm = ref("")
6061
6162
const bounce = ref(false)
6263
63-
const developerMode = ref(false)
6464
const featurePreviewMode = ref(false)
6565
6666
const mode = ref(null)
@@ -847,7 +847,6 @@ const rawOtherActions = [
847847
subtitle: "Command",
848848
runText: "Toggle",
849849
callback: () => {
850-
localStorage.developer = !localStorage.developer
851850
developerMode.value = !developerMode.value
852851
853852
notificationsStore.create({
@@ -1067,7 +1066,6 @@ const handleShareCopyData = (data) => {
10671066
}
10681067
10691068
onMounted(() => {
1070-
developerMode.value = localStorage.developer
10711069
featurePreviewMode.value = localStorage.featurePreview
10721070
10731071
root = document.querySelector("html")

0 commit comments

Comments
 (0)