You've already forked AstralRinth
forked from didirus/AstralRinth
Bump tauri to v2 (#3018)
* Bump tauri to v2 * Switch to virtual typed list for content page * Fix unexpected hang on windows * Fix ads window scaling issues on some devices * Use DPR from browser * Fix link opens, bump version, fix lint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "theseus"
|
||||
version = "0.8.9"
|
||||
version = "0.9.0"
|
||||
authors = ["Jai A <jaiagr+gpg@pm.me>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -105,7 +105,10 @@ impl State {
|
||||
/// Get the current launcher state, waiting for initialization
|
||||
pub async fn get() -> crate::Result<Arc<Self>> {
|
||||
if !LAUNCHER_STATE.initialized() {
|
||||
while !LAUNCHER_STATE.initialized() {}
|
||||
tracing::error!("Attempted to get state before it is initialized - this should never happen!");
|
||||
while !LAUNCHER_STATE.initialized() {
|
||||
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Arc::clone(
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"qrcode.vue": "^3.4.1",
|
||||
"vue-multiselect": "3.0.0",
|
||||
"vue-select": "4.0.0-beta.6",
|
||||
"vue-virtual-scroller": "v2.0.0-beta.8",
|
||||
"vue-typed-virtual-list": "^1.0.10",
|
||||
"vue3-apexcharts": "^1.4.4",
|
||||
"xss": "^1.0.14"
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ import Checkbox from '../base/Checkbox.vue'
|
||||
import ContentListItem from './ContentListItem.vue'
|
||||
import type { ContentItem } from './ContentListItem.vue'
|
||||
import { DropdownIcon } from '@modrinth/assets'
|
||||
import { RecycleScroller } from 'vue-virtual-scroller'
|
||||
import { createVirtualScroller } from 'vue-typed-virtual-list'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -17,6 +17,8 @@ const props = withDefaults(
|
||||
{},
|
||||
)
|
||||
|
||||
const VirtualScroller = createVirtualScroller()
|
||||
|
||||
const selectionStates: Ref<Record<string, boolean>> = ref({})
|
||||
const selected: Ref<string[]> = computed(() =>
|
||||
Object.keys(selectionStates.value).filter(
|
||||
@@ -76,26 +78,21 @@ function setSelected(value: boolean) {
|
||||
</slot>
|
||||
</div>
|
||||
<div class="bg-bg-raised rounded-xl">
|
||||
<RecycleScroller
|
||||
v-slot="{ item, index }"
|
||||
:items="items"
|
||||
:item-size="64"
|
||||
disable-transform
|
||||
key-field="filename"
|
||||
style="height: 100%"
|
||||
>
|
||||
<ContentListItem
|
||||
v-model="selectionStates[item.filename]"
|
||||
:item="item"
|
||||
:last="props.items.length - 1 === index"
|
||||
class="mb-2"
|
||||
@update:model-value="updateSelection"
|
||||
>
|
||||
<template #actions="{ item }">
|
||||
<slot name="actions" :item="item" />
|
||||
</template>
|
||||
</ContentListItem>
|
||||
</RecycleScroller>
|
||||
<VirtualScroller :items="items" :default-size="64" style="height: 100%">
|
||||
<template #item="{ ref }">
|
||||
<ContentListItem
|
||||
v-model="selectionStates[ref.filename]"
|
||||
:item="ref"
|
||||
:last="false"
|
||||
class="mb-2"
|
||||
@update:model-value="updateSelection"
|
||||
>
|
||||
<template #actions="{ item }">
|
||||
<slot name="actions" :item="item" />
|
||||
</template>
|
||||
</ContentListItem>
|
||||
</template>
|
||||
</VirtualScroller>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user