mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 01:26:23 +00:00
refactor: align files tab with content tab design (#5621)
* fix: files.vue bugs before styling changes
* feat: move files tab to shared layout structure
* fix: qa
* fix: qa
* fix: bugs
* fix: lint
* fix: admonition cleanup with progress + actions
* fix: cleanup
* fix: modals
* fix: admon title
* fix: i18n standard
* fix: lint + i18n pass
* fix: remove transition
* fix: type errors
* feat: files tab in app
* fix: qa
* fix: backup item minmax
* fix: use ContentPageHeader for server panel
* fix: lint
* fix: lint
* fix: lint
* feat: page leave safety
* fix: lint
* fix: cargo fmt fix
* fix: blank in prod
* fix: content card table stuff
* Revert "fix: blank in prod"
This reverts commit 74758fe185.
* fix: import
* feat: browse worlds/servers flow
* fix: worlds tab parity with content tab
* fix: perf bug + shader filter pill copy
* feat: singleplayer filter
* fix: ordering
* fix: breadcrumbs
* fix: lint
* fix: qa
* feat: store server proj id when adding to a non-linked instance
* fix: lint
* fix: i18n + qa
* fix: conflict
* qa: already installed modal + placeholders not server-specific
* fix: qa
* fix: add + edit server modals
* fix: qa
* fix: security
* fix: devin flags
* fix: lint
* chore: change file to break build cache
* fix: admon
* fix: import path stuff
* feat: qa
* fix: fmt fmt idiot
---------
Signed-off-by: Calum H. <calum@modrinth.com>
This commit is contained in:
+16
-8
@@ -98,7 +98,7 @@
|
||||
import { ChevronRightIcon, FolderSearchIcon, SearchIcon } from '@modrinth/assets'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
|
||||
import { injectInstanceImport } from '../../../../providers'
|
||||
import { injectInstanceImport, injectNotificationManager } from '../../../../providers'
|
||||
import type { ImportableLauncher } from '../../../../providers/instance-import'
|
||||
import ButtonStyled from '../../../base/ButtonStyled.vue'
|
||||
import Checkbox from '../../../base/Checkbox.vue'
|
||||
@@ -108,6 +108,7 @@ import { injectCreationFlowContext } from '../creation-flow-context'
|
||||
|
||||
const ctx = injectCreationFlowContext()
|
||||
const importProvider = injectInstanceImport()
|
||||
const { addNotification } = injectNotificationManager()
|
||||
|
||||
const loading = ref(false)
|
||||
const expandedLaunchers = ref(new Set<string>())
|
||||
@@ -257,6 +258,14 @@ async function addLauncherPath() {
|
||||
|
||||
try {
|
||||
const instances = await importProvider.getImportableInstances('Custom', path)
|
||||
if (instances.length === 0) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
title: 'No instances found',
|
||||
text: `No importable instances were found at the specified path.`,
|
||||
})
|
||||
return
|
||||
}
|
||||
const launcher: ImportableLauncher = {
|
||||
name: `Custom (${path.split(/[\\/]/).pop() || path})`,
|
||||
path,
|
||||
@@ -266,13 +275,12 @@ async function addLauncherPath() {
|
||||
expandedLaunchers.value.add(launcher.name)
|
||||
expandedLaunchers.value = new Set(expandedLaunchers.value)
|
||||
} catch {
|
||||
// Failed to load — still add with empty instances
|
||||
const launcher: ImportableLauncher = {
|
||||
name: `Custom (${path.split(/[\\/]/).pop() || path})`,
|
||||
path,
|
||||
instances: [],
|
||||
}
|
||||
ctx.importLaunchers.value = [...ctx.importLaunchers.value, launcher]
|
||||
addNotification({
|
||||
type: 'error',
|
||||
title: 'No instances found',
|
||||
text: `No importable instances were found at the specified path.`,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
newLauncherPath.value = ''
|
||||
|
||||
Reference in New Issue
Block a user