This commit is contained in:
xds
2026-02-24 12:47:19 +03:00
parent a1d37ac517
commit 122c5a7cbc
5 changed files with 38 additions and 7 deletions

View File

@@ -201,6 +201,7 @@ watch(isSettingsVisible, (val) => {
const activeOverlayId = ref(null) // For mobile tap-to-show overlay
const filterCharacter = ref(null) // Character filter for gallery
const onlyLiked = ref(false)
// Options
const qualityOptions = ref([
@@ -287,6 +288,13 @@ watch(filterCharacter, async () => {
await refreshHistory()
})
watch(onlyLiked, async () => {
historyGenerations.value = []
historyTotal.value = 0
historyFirst.value = 0
await refreshHistory()
})
// --- Data Loading ---
const loadData = async () => {
@@ -364,7 +372,7 @@ const loadData = async () => {
const refreshHistory = async () => {
try {
const response = await aiService.getGenerations(historyRows.value, 0, filterCharacter.value?.id || filterCharacter.value?._id)
const response = await aiService.getGenerations(historyRows.value, 0, filterCharacter.value?.id || filterCharacter.value?._id, onlyLiked.value)
if (response && response.generations) {
// Update existing items and add new ones at the top
const newGenerations = []
@@ -525,7 +533,7 @@ const loadMoreHistory = async () => {
try {
const nextOffset = historyGenerations.value.length
const response = await aiService.getGenerations(historyRows.value, nextOffset, filterCharacter.value?.id)
const response = await aiService.getGenerations(historyRows.value, nextOffset, filterCharacter.value?.id, onlyLiked.value)
if (response && response.generations) {
const newGenerations = response.generations.filter(gen =>
@@ -880,6 +888,11 @@ const confirmAddToAlbum = async () => {
</div>
</template>
</Dropdown>
<Button :icon="onlyLiked ? 'pi pi-heart-fill' : 'pi pi-heart'"
@click="onlyLiked = !onlyLiked" rounded text
class="!w-7 !h-7 !p-0"
:class="onlyLiked ? '!text-pink-500 !bg-pink-500/10' : '!text-slate-400 hover:!bg-white/10'"
v-tooltip.bottom="onlyLiked ? 'Show all' : 'Show liked only'" />
<Button icon="pi pi-refresh" @click="refreshHistory" rounded text
class="!text-slate-400 hover:!bg-white/10 !w-7 !h-7 !p-0 md:hidden" />
<Button :icon="isSelectMode ? 'pi pi-times' : 'pi pi-check-square'" @click="toggleSelectMode"