fix: try fix dayjs init
Signed-off-by: Innei <i@innei.in>
This commit is contained in:
parent
7c60d5e91d
commit
093f80d9da
|
|
@ -29,15 +29,13 @@ export const SentryConfig: BrowserOptions = {
|
|||
|
||||
beforeSend(event, hint) {
|
||||
const error = hint.originalException
|
||||
const errorMessage = error instanceof Error ? error.message : String(error)
|
||||
const isIgnoredError = ERROR_PATTERNS.some((pattern) =>
|
||||
pattern instanceof RegExp ? pattern.test(errorMessage) : errorMessage.includes(pattern),
|
||||
)
|
||||
|
||||
if (error instanceof Error) {
|
||||
const isIgnoredError = ERROR_PATTERNS.some((pattern) =>
|
||||
pattern instanceof RegExp ? pattern.test(error.message) : error.message.includes(pattern),
|
||||
)
|
||||
|
||||
if (isIgnoredError) {
|
||||
return null
|
||||
}
|
||||
if (isIgnoredError) {
|
||||
return null
|
||||
}
|
||||
|
||||
const isPassthroughError = [CustomSafeError, FetchError].some((errorType) => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { initializeDayjs } from "@follow/components/dayjs"
|
||||
import { registerGlobalContext } from "@follow/shared/bridge"
|
||||
import { IN_ELECTRON } from "@follow/shared/constants"
|
||||
import { env } from "@follow/shared/env"
|
||||
|
|
@ -49,6 +50,7 @@ export const initializeApp = async () => {
|
|||
basePath: "/auth",
|
||||
credentials: "include",
|
||||
})
|
||||
initializeDayjs()
|
||||
|
||||
// Set Environment
|
||||
document.documentElement.dataset.buildType = isElectronBuild ? "electron" : "web"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import "./wdyr"
|
||||
import "@follow/components/tailwind"
|
||||
import "@follow/components/dayjs"
|
||||
import "./styles/main.css"
|
||||
|
||||
import { IN_ELECTRON } from "@follow/shared/constants"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import duration from "dayjs/plugin/duration"
|
|||
import localizedFormat from "dayjs/plugin/localizedFormat"
|
||||
import relativeTime from "dayjs/plugin/relativeTime"
|
||||
// Initialize dayjs
|
||||
dayjs.extend(duration)
|
||||
dayjs.extend(relativeTime)
|
||||
dayjs.extend(localizedFormat)
|
||||
export const initializeDayjs = () => {
|
||||
dayjs.extend(duration)
|
||||
dayjs.extend(relativeTime)
|
||||
dayjs.extend(localizedFormat)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue