Compare commits
14 Commits
bug/broken
...
fix/switch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44ef51644e | ||
|
|
252fe9e5d6 | ||
|
|
a52ef2de9a | ||
|
|
f04149d971 | ||
|
|
ed9f412c5c | ||
|
|
8765c1a8ac | ||
|
|
b2693d6ba2 | ||
|
|
d9ed10bcca | ||
|
|
87685b8cd9 | ||
|
|
00fcc78f85 | ||
|
|
81e090bbba | ||
|
|
87ba02053b | ||
|
|
fb08147c66 | ||
|
|
d129676cd6 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-backend",
|
"name": "hoppscotch-backend",
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/common",
|
"name": "@hoppscotch/common",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ declare module '@vue/runtime-core' {
|
|||||||
IconLucideListEnd: typeof import('~icons/lucide/list-end')['default']
|
IconLucideListEnd: typeof import('~icons/lucide/list-end')['default']
|
||||||
IconLucideMinus: typeof import('~icons/lucide/minus')['default']
|
IconLucideMinus: typeof import('~icons/lucide/minus')['default']
|
||||||
IconLucideSearch: typeof import('~icons/lucide/search')['default']
|
IconLucideSearch: typeof import('~icons/lucide/search')['default']
|
||||||
|
IconLucideUser: typeof import('~icons/lucide/user')['default']
|
||||||
IconLucideUsers: typeof import('~icons/lucide/users')['default']
|
IconLucideUsers: typeof import('~icons/lucide/users')['default']
|
||||||
LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default']
|
LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default']
|
||||||
LensesHeadersRendererEntry: typeof import('./components/lenses/HeadersRendererEntry.vue')['default']
|
LensesHeadersRendererEntry: typeof import('./components/lenses/HeadersRendererEntry.vue')['default']
|
||||||
@@ -141,6 +142,7 @@ declare module '@vue/runtime-core' {
|
|||||||
LensesRenderersRawLensRenderer: typeof import('./components/lenses/renderers/RawLensRenderer.vue')['default']
|
LensesRenderersRawLensRenderer: typeof import('./components/lenses/renderers/RawLensRenderer.vue')['default']
|
||||||
LensesRenderersXMLLensRenderer: typeof import('./components/lenses/renderers/XMLLensRenderer.vue')['default']
|
LensesRenderersXMLLensRenderer: typeof import('./components/lenses/renderers/XMLLensRenderer.vue')['default']
|
||||||
LensesResponseBodyRenderer: typeof import('./components/lenses/ResponseBodyRenderer.vue')['default']
|
LensesResponseBodyRenderer: typeof import('./components/lenses/ResponseBodyRenderer.vue')['default']
|
||||||
|
ProfilePicture: typeof import('./components/profile/Picture.vue')['default']
|
||||||
ProfileShortcode: typeof import('./components/profile/Shortcode.vue')['default']
|
ProfileShortcode: typeof import('./components/profile/Shortcode.vue')['default']
|
||||||
ProfileShortcodes: typeof import('./components/profile/Shortcodes.vue')['default']
|
ProfileShortcodes: typeof import('./components/profile/Shortcodes.vue')['default']
|
||||||
ProfileUserDelete: typeof import('./components/profile/UserDelete.vue')['default']
|
ProfileUserDelete: typeof import('./components/profile/UserDelete.vue')['default']
|
||||||
|
|||||||
@@ -36,12 +36,13 @@
|
|||||||
? IconCheck
|
? IconCheck
|
||||||
: undefined
|
: undefined
|
||||||
"
|
"
|
||||||
|
class="my-2"
|
||||||
:active-info-icon="
|
:active-info-icon="
|
||||||
selectedEnvironmentIndex.type === 'NO_ENV_SELECTED'
|
selectedEnvironmentIndex.type === 'NO_ENV_SELECTED'
|
||||||
"
|
"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
selectedEnvironmentIndex = { type: 'NO_ENV_SELECTED' }
|
setSelectedEnvironmentIndex({ type: 'NO_ENV_SELECTED' })
|
||||||
hide()
|
hide()
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ const switchToMyEnvironments = () => {
|
|||||||
adapter.changeTeamID(undefined)
|
adapter.changeTeamID(undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateSelectedTeam = (newSelectedTeam: SelectedTeam | undefined) => {
|
const updateSelectedTeam = (newSelectedTeam: SelectedTeam) => {
|
||||||
if (newSelectedTeam) {
|
if (newSelectedTeam) {
|
||||||
environmentType.value.selectedTeam = newSelectedTeam
|
environmentType.value.selectedTeam = newSelectedTeam
|
||||||
REMEMBERED_TEAM_ID.value = newSelectedTeam.id
|
REMEMBERED_TEAM_ID.value = newSelectedTeam.id
|
||||||
@@ -150,27 +150,25 @@ const workspace = useReadonlyStream(workspaceStatus$, { type: "personal" })
|
|||||||
// Used to switch environment type and team when user switch workspace in the global workspace switcher
|
// Used to switch environment type and team when user switch workspace in the global workspace switcher
|
||||||
// Check if there is a teamID in the workspace, if yes, switch to team environment and select the team
|
// Check if there is a teamID in the workspace, if yes, switch to team environment and select the team
|
||||||
// If there is no teamID, switch to my environment
|
// If there is no teamID, switch to my environment
|
||||||
watch(workspace, (newWorkspace, oldWorkspace) => {
|
watch(
|
||||||
// If we are switching into personal from outside
|
() => workspace.value.type === "team" && workspace.value.teamID,
|
||||||
if (newWorkspace.type === "personal" && oldWorkspace.type !== "personal") {
|
(teamID) => {
|
||||||
// If the selected environment is not a my environment, turn off the env
|
if (!teamID) {
|
||||||
if (selectedEnvironmentIndex.value.type !== "MY_ENV") {
|
|
||||||
switchToMyEnvironments()
|
switchToMyEnvironments()
|
||||||
setSelectedEnvironmentIndex({
|
setSelectedEnvironmentIndex({
|
||||||
type: "NO_ENV_SELECTED",
|
type: "NO_ENV_SELECTED",
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
} else if (newWorkspace.type === "team") {
|
const team = myTeams.value?.find((t) => t.id === teamID)
|
||||||
const team = myTeams.value?.find((t) => t.id === newWorkspace.teamID)
|
if (team) {
|
||||||
updateSelectedTeam(team)
|
updateSelectedTeam(team)
|
||||||
|
setSelectedEnvironmentIndex({
|
||||||
if (selectedEnvironmentIndex.value.type !== "MY_ENV") {
|
type: "NO_ENV_SELECTED",
|
||||||
setSelectedEnvironmentIndex({
|
})
|
||||||
type: "NO_ENV_SELECTED",
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => currentUser.value,
|
() => currentUser.value,
|
||||||
|
|||||||
@@ -42,21 +42,16 @@ const dispatchers = defineDispatchers({
|
|||||||
selectedEnvironmentIndex,
|
selectedEnvironmentIndex,
|
||||||
}: { selectedEnvironmentIndex: SelectedEnvironmentIndex }
|
}: { selectedEnvironmentIndex: SelectedEnvironmentIndex }
|
||||||
) {
|
) {
|
||||||
if (selectedEnvironmentIndex.type === "MY_ENV") {
|
if (
|
||||||
if (store.environments[selectedEnvironmentIndex.index]) {
|
selectedEnvironmentIndex.type === "MY_ENV" &&
|
||||||
return {
|
!!store.environments[selectedEnvironmentIndex.index]
|
||||||
selectedEnvironmentIndex,
|
) {
|
||||||
}
|
return {
|
||||||
} else {
|
selectedEnvironmentIndex,
|
||||||
return {
|
|
||||||
selectedEnvironmentIndex: {
|
|
||||||
type: "NO_ENV_SELECTED",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
selectedEnvironmentIndex,
|
type: "NO_ENV_SELECTED",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/selfhost-web",
|
"name": "@hoppscotch/selfhost-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-sh-admin",
|
"name": "hoppscotch-sh-admin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
|
|||||||
Reference in New Issue
Block a user