Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

refactor: remove EAInvite flag

liyasthomas258f79604f8b
diff --git a/packages/hoppscotch-app/components/collections/ChooseType.vue b/packages/hoppscotch-app/components/collections/ChooseType.vue
index 01665ed55..d87bddb70 100644
--- a/packages/hoppscotch-app/components/collections/ChooseType.vue
+++ b/packages/hoppscotch-app/components/collections/ChooseType.vue
@@ -7,7 +7,7 @@
:selected="true"
/>
<SmartTab
- v-if="currentUser && currentUser.eaInvited && !doc"
+ v-if="currentUser && !doc"
:id="'team-collections'"
:label="`${$t('collection.team_collections')}`"
>
diff --git a/packages/hoppscotch-app/components/teams/Add.vue b/packages/hoppscotch-app/components/teams/Add.vue
index c80c37746..9d70e2de8 100644
--- a/packages/hoppscotch-app/components/teams/Add.vue
+++ b/packages/hoppscotch-app/components/teams/Add.vue
@@ -44,7 +44,7 @@ const {
$toast,
} = useContext()
-const $t = i18n.t.bind(i18n)
+const t = i18n.t.bind(i18n)
defineProps<{
show: boolean
@@ -66,7 +66,7 @@ const addNewTeam = () =>
(err) => {
// err is of type "invalid_name" | GQLError<Err>
if (err === "invalid_name") {
- $toast.error($t("team.name_length_insufficient").toString(), {
+ $toast.error(t("team.name_length_insufficient").toString(), {
icon: "error_outline",
})
} else {
diff --git a/packages/hoppscotch-app/components/teams/index.vue b/packages/hoppscotch-app/components/teams/index.vue
index e379cbba0..104eed298 100644
--- a/packages/hoppscotch-app/components/teams/index.vue
+++ b/packages/hoppscotch-app/components/teams/index.vue
@@ -36,6 +36,13 @@
@edit-team="editTeam(team, team.id)"
/>
</div>
+ <div
+ v-if="!myTeams.loading && E.isLeft(myTeams.data)"
+ class="flex items-center flex-col"
+ >
+ <i class="mb-4 material-icons">help_outline</i>
+ {{ $t("error.something_went_wrong") }}
+ </div>
</div>
<TeamsAdd :show="showModalAdd" @hide-modal="displayModalAdd(false)" />
<!-- ¯\_(ツ)_/¯ -->
diff --git a/packages/hoppscotch-app/helpers/teams/BackendUserInfo.ts b/packages/hoppscotch-app/helpers/teams/BackendUserInfo.ts
index b0e504210..e42fd4705 100644
--- a/packages/hoppscotch-app/helpers/teams/BackendUserInfo.ts
+++ b/packages/hoppscotch-app/helpers/teams/BackendUserInfo.ts
@@ -28,10 +28,6 @@ export interface UserInfo {
* URL to the profile photo of the user (or null if none available)
*/
photoURL: string | null
- /**
- * Whether the user has access to Early Access features
- */
- eaInvited: boolean
}
/**
@@ -65,7 +61,6 @@ async function updateUserInfo() {
displayName
email
photoURL
- eaInvited
}
}
`,
@@ -76,7 +71,6 @@ async function updateUserInfo() {
displayName: data.me.displayName,
email: data.me.email,
photoURL: data.me.photoURL,
- eaInvited: data.me.eaInvited,
})
} catch (e) {
currentUserInfo$.next(null)
diff --git a/packages/hoppscotch-app/pages/profile.vue b/packages/hoppscotch-app/pages/profile.vue
index 88115df9a..424192511 100644
--- a/packages/hoppscotch-app/pages/profile.vue
+++ b/packages/hoppscotch-app/pages/profile.vue
@@ -47,9 +47,7 @@
<div class="flex items-center">
<SmartToggle
:on="SYNC_COLLECTIONS"
- @change="
- toggleSettings('syncCollections', !SYNC_COLLECTIONS)
- "
+ @change="toggleSetting('syncCollections')"
>
{{ $t("settings.sync_collections") }}
</SmartToggle>
@@ -57,9 +55,7 @@
<div class="flex items-center">
<SmartToggle
:on="SYNC_ENVIRONMENTS"
- @change="
- toggleSettings('syncEnvironments', !SYNC_ENVIRONMENTS)
- "
+ @change="toggleSetting('syncEnvironments')"
>
{{ $t("settings.sync_environments") }}
</SmartToggle>
@@ -67,7 +63,7 @@
<div class="flex items-center">
<SmartToggle
:on="SYNC_HISTORY"
- @change="toggleSettings('syncHistory', !SYNC_HISTORY)"
+ @change="toggleSetting('syncHistory')"
>
{{ $t("settings.sync_history") }}
</SmartToggle>
@@ -75,11 +71,7 @@
</div>
</section>
</SmartTab>
- <SmartTab
- v-if="currentBackendUser && currentBackendUser.eaInvited"
- :id="'teams'"
- :label="$t('team.title')"
- >
+ <SmartTab :id="'teams'" :label="$t('team.title')">
<AppSection label="teams">
<Teams />
</AppSection>
@@ -92,47 +84,37 @@
</div>
</template>
-<script lang="ts">
-import { defineComponent } from "@nuxtjs/composition-api"
-import { currentUserInfo$ } from "~/helpers/teams/BackendUserInfo"
+<script setup lang="ts">
+import {
+ ref,
+ useContext,
+ useMeta,
+ defineComponent,
+} from "@nuxtjs/composition-api"
import { currentUser$ } from "~/helpers/fb/auth"
import { useReadonlyStream } from "~/helpers/utils/composables"
-import { applySetting, SettingsType, useSetting } from "~/newstore/settings"
-import { KeysMatching } from "~/types/ts-utils"
+import { toggleSetting, useSetting } from "~/newstore/settings"
+
+const {
+ app: { i18n },
+} = useContext()
+
+const t = i18n.t.bind(i18n)
+
+const showLogin = ref(false)
+const SYNC_COLLECTIONS = useSetting("syncCollections")
+const SYNC_ENVIRONMENTS = useSetting("syncEnvironments")
+const SYNC_HISTORY = useSetting("syncHistory")
+const currentUser = useReadonlyStream(currentUser$, null)
+
+useMeta({
+ title: `${t("navigation.profile")} • Hoppscotch`,
+})
+</script>
+
+<script lang="ts">
export default defineComponent({
- setup() {
- return {
- SYNC_COLLECTIONS: useSetting("syncCollections"),
- SYNC_ENVIRONMENTS: useSetting("syncEnvironments"),
- SYNC_HISTORY: useSetting("syncHistory"),
- currentUser: useReadonlyStream(currentUser$, currentUser$.value),
- currentBackendUser: useReadonlyStream(
- currentUserInfo$,
- currentUserInfo$.value
- ),
- }
- },
- data() {
- return {
- showLogin: false,
- }
- },
- head() {
- return {
- title: `${this.$t("navigation.profile")} • Hoppscotch`,
- }
- },
- methods: {
- applySetting<K extends keyof SettingsType>(key: K, value: SettingsType[K]) {
- applySetting(key, value)
- },
- toggleSettings<K extends KeysMatching<SettingsType, boolean>>(
- name: K,
- value: SettingsType[K]
- ) {
- this.applySetting(name, value)
- },
- },
+ head: {},
})
</script>