mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 09:34:50 +00:00
qa: shared instances post release (#6893)
* fix: 20 user cap * qa: invite modal dropdown + other + clamp limits * fix: hide filters if just one type * feat: update req banner * feat: invite management frontend * fix: moderation issues with shared instances * feat: instance icon improvements * fix: better offline handling * fix: lint * feat: show avatar in install to play modal * feat: smaller qa points * fix: fmt * fix: fmt * fix: yeet svg * fix: 50 user limit
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { defineMessages, injectNotificationManager, useVIntl } from '@modrinth/ui'
|
||||
|
||||
import { getErrorMessage, type SharedInstanceUnavailableReason } from '@/helpers/install'
|
||||
import {
|
||||
getErrorMessage,
|
||||
isSharedInstancesApiError,
|
||||
type SharedInstanceUnavailableReason,
|
||||
} from '@/helpers/install'
|
||||
|
||||
export const sharedInstanceErrorMessages = defineMessages({
|
||||
unavailableTitle: {
|
||||
@@ -39,6 +43,14 @@ export const sharedInstanceErrorMessages = defineMessages({
|
||||
id: 'instance.shared-instance.error.title',
|
||||
defaultMessage: 'Something has gone wrong',
|
||||
},
|
||||
networkErrorTitle: {
|
||||
id: 'instance.shared-instance.network-error.title',
|
||||
defaultMessage: 'Network error',
|
||||
},
|
||||
networkErrorText: {
|
||||
id: 'instance.shared-instance.network-error.text',
|
||||
defaultMessage: 'Unable to connect to shared instances API',
|
||||
},
|
||||
})
|
||||
|
||||
export function sharedInstanceUnavailableTextMessage(
|
||||
@@ -82,7 +94,20 @@ export function useSharedInstanceErrors() {
|
||||
})
|
||||
}
|
||||
|
||||
function notifySharedInstanceConnectionError() {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
title: formatMessage(sharedInstanceErrorMessages.networkErrorTitle),
|
||||
text: formatMessage(sharedInstanceErrorMessages.networkErrorText),
|
||||
})
|
||||
}
|
||||
|
||||
function notifySharedInstanceError(error: unknown) {
|
||||
if (isSharedInstancesApiError(error)) {
|
||||
notifySharedInstanceConnectionError()
|
||||
return
|
||||
}
|
||||
|
||||
addNotification({
|
||||
type: 'error',
|
||||
title: formatMessage(sharedInstanceErrorMessages.errorTitle),
|
||||
@@ -92,6 +117,7 @@ export function useSharedInstanceErrors() {
|
||||
|
||||
return {
|
||||
formatSharedInstanceUnavailable,
|
||||
notifySharedInstanceConnectionError,
|
||||
notifySharedInstanceError,
|
||||
notifySharedInstanceUnavailable,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user