chore: minor fixes and improvements
This commit is contained in:
@@ -102,13 +102,13 @@ const client = createClient({
|
||||
*/
|
||||
export type GQLError<T extends string> =
|
||||
| {
|
||||
type: "network_error"
|
||||
error: Error
|
||||
}
|
||||
type: "network_error"
|
||||
error: Error
|
||||
}
|
||||
| {
|
||||
type: "gql_error"
|
||||
error: T
|
||||
}
|
||||
type: "gql_error"
|
||||
error: T
|
||||
}
|
||||
|
||||
const DEFAULT_QUERY_OPTIONS = {
|
||||
noPolling: false,
|
||||
@@ -124,10 +124,10 @@ type UseQueryLoading = {
|
||||
type UseQueryLoaded<
|
||||
QueryFailType extends string = "",
|
||||
QueryReturnType = any
|
||||
> = {
|
||||
loading: false
|
||||
data: E.Either<GQLError<QueryFailType>, QueryReturnType>
|
||||
}
|
||||
> = {
|
||||
loading: false
|
||||
data: E.Either<GQLError<QueryFailType>, QueryReturnType>
|
||||
}
|
||||
|
||||
type UseQueryReturn<QueryFailType extends string = "", QueryReturnType = any> =
|
||||
| UseQueryLoading
|
||||
@@ -218,9 +218,9 @@ export function useGQLQuery<
|
||||
data: data!,
|
||||
}) as
|
||||
| {
|
||||
loading: false
|
||||
data: DataType
|
||||
}
|
||||
loading: false
|
||||
data: DataType
|
||||
}
|
||||
| { loading: true }
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ export const resolversDef: GraphCacheResolvers = {
|
||||
}),
|
||||
user: (_parent, { uid }, _cache, _info) => ({
|
||||
__typename: "User",
|
||||
uid: uid,
|
||||
uid,
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -9,9 +9,7 @@ export const updatesDef: GraphCacheUpdaters = {
|
||||
},
|
||||
(data) => {
|
||||
if (data) {
|
||||
data.myTeams = data.myTeams.filter(
|
||||
(x) => x.id !== teamID
|
||||
)
|
||||
data.myTeams = data.myTeams.filter((x) => x.id !== teamID)
|
||||
}
|
||||
|
||||
return data
|
||||
@@ -20,7 +18,7 @@ export const updatesDef: GraphCacheUpdaters = {
|
||||
|
||||
cache.invalidate({
|
||||
__typename: "Team",
|
||||
id: teamID
|
||||
id: teamID,
|
||||
})
|
||||
},
|
||||
leaveTeam: (_r, { teamID }, cache, _info) => {
|
||||
@@ -30,9 +28,7 @@ export const updatesDef: GraphCacheUpdaters = {
|
||||
},
|
||||
(data) => {
|
||||
if (data) {
|
||||
data.myTeams = data.myTeams.filter(
|
||||
(x) => x.id !== teamID
|
||||
)
|
||||
data.myTeams = data.myTeams.filter((x) => x.id !== teamID)
|
||||
}
|
||||
|
||||
return data
|
||||
@@ -41,7 +37,7 @@ export const updatesDef: GraphCacheUpdaters = {
|
||||
|
||||
cache.invalidate({
|
||||
__typename: "Team",
|
||||
id: teamID
|
||||
id: teamID,
|
||||
})
|
||||
},
|
||||
createTeam: (result, _args, cache, _info) => {
|
||||
@@ -70,11 +66,7 @@ export const updatesDef: GraphCacheUpdaters = {
|
||||
.filter(([_key, uid]) => uid !== userUid)
|
||||
.map(([key]) => key)
|
||||
|
||||
cache.link(
|
||||
{ __typename: "Team", id: teamID },
|
||||
"members",
|
||||
newMembers
|
||||
)
|
||||
cache.link({ __typename: "Team", id: teamID }, "members", newMembers)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
>
|
||||
<Pane class="flex flex-1 hide-scrollbar !overflow-auto">
|
||||
<main class="flex flex-1 w-full">
|
||||
<nuxt class="flex overflow-y-auto flex-1" />
|
||||
<nuxt class="flex flex-1" style="overflow-y: overlay" />
|
||||
</main>
|
||||
</Pane>
|
||||
</Splitpanes>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="divide-y divide-dividerLight container space-y-8">
|
||||
<div class="md:grid md:gap-4 md:grid-cols-3">
|
||||
<div class="p-4 md:col-span-1">
|
||||
<div class="p-8 md:col-span-1">
|
||||
<h3 class="heading">
|
||||
{{ $t("settings.theme") }}
|
||||
</h3>
|
||||
@@ -10,7 +10,7 @@
|
||||
{{ $t("settings.theme_description") }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="space-y-8 p-4 md:col-span-2">
|
||||
<div class="space-y-8 p-8 md:col-span-2">
|
||||
<section>
|
||||
<h4 class="font-semibold text-secondaryDark">
|
||||
{{ $t("settings.background") }}
|
||||
@@ -110,7 +110,7 @@
|
||||
</div>
|
||||
|
||||
<div class="md:grid md:gap-4 md:grid-cols-3">
|
||||
<div class="p-4 md:col-span-1">
|
||||
<div class="p-8 md:col-span-1">
|
||||
<h3 class="heading">
|
||||
{{ $t("settings.interceptor") }}
|
||||
</h3>
|
||||
@@ -118,7 +118,7 @@
|
||||
{{ $t("settings.interceptor_description") }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="space-y-8 p-4 md:col-span-2">
|
||||
<div class="space-y-8 p-8 md:col-span-2">
|
||||
<section>
|
||||
<h4 class="font-semibold text-secondaryDark">
|
||||
{{ $t("settings.extensions") }}
|
||||
|
||||
Reference in New Issue
Block a user