You've already forked AstralRinth
forked from didirus/AstralRinth
fix: DI nonsense (#4174)
* fix: DI nonsense * fix: lint * fix: client try di issue * fix: injects outside of context * fix: use .catch * refactor: convert projects.vue to composition API. * fix: moderation checklist notif pos change watcher * fix: lint issues
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { injectNotificationManager } from '@modrinth/ui'
|
||||
import { getVersion } from '@tauri-apps/api/app'
|
||||
import { fetch } from '@tauri-apps/plugin-http'
|
||||
|
||||
@@ -11,9 +10,9 @@ export const useFetch = async (url, item, isSilent) => {
|
||||
})
|
||||
} catch (err) {
|
||||
if (!isSilent) {
|
||||
const { handleError } = injectNotificationManager()
|
||||
handleError({ message: `Error fetching ${item}` })
|
||||
throw err
|
||||
} else {
|
||||
console.error(err)
|
||||
}
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* So, for example, addDefaultInstance creates a blank Profile object, where the Rust struct is serialized,
|
||||
* and deserialized into a usable JS object.
|
||||
*/
|
||||
import { injectNotificationManager } from '@modrinth/ui'
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
import { install_to_existing_profile } from '@/helpers/pack.js'
|
||||
@@ -194,7 +193,6 @@ export async function edit_icon(path, iconPath) {
|
||||
}
|
||||
|
||||
export async function finish_install(instance) {
|
||||
const { handleError } = injectNotificationManager()
|
||||
if (instance.install_stage !== 'pack_installed') {
|
||||
let linkedData = instance.linked_data
|
||||
await install_to_existing_profile(
|
||||
@@ -202,8 +200,8 @@ export async function finish_install(instance) {
|
||||
linkedData.version_id,
|
||||
instance.name,
|
||||
instance.path,
|
||||
).catch(handleError)
|
||||
)
|
||||
} else {
|
||||
await install(instance.path, false).catch(handleError)
|
||||
await install(instance.path, false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { injectNotificationManager } from '@modrinth/ui'
|
||||
import { arrayBufferToBase64 } from '@modrinth/utils'
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
@@ -39,8 +38,7 @@ export const DEFAULT_MODELS: Record<string, SkinModel> = {
|
||||
|
||||
export function filterSavedSkins(list: Skin[]) {
|
||||
const customSkins = list.filter((s) => s.source !== 'default')
|
||||
const { handleError } = injectNotificationManager()
|
||||
fixUnknownSkins(customSkins).catch(handleError)
|
||||
fixUnknownSkins(customSkins)
|
||||
return customSkins
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user