This commit is contained in:
mattyatea 2023-11-19 17:55:34 +09:00
parent 9e9c76fa57
commit 4e3aacc113
3 changed files with 14 additions and 11 deletions

View File

@ -36,7 +36,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-if="item.indicate" :class="$style.indicator"><i class="_indicatorCircle"></i></span> <span v-if="item.indicate" :class="$style.indicator"><i class="_indicatorCircle"></i></span>
</button> </button>
<button v-else-if="item.type === 'switch'" role="menuitemcheckbox" :tabindex="i" class="_button" :class="[$style.item, $style.switch, { [$style.switchDisabled]: item.disabled } , { [$style.gamingDark]: gamingType === 'dark',[$style.gamingLight]: gamingType === 'light' }]" @click="switchItem(item)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)"> <button v-else-if="item.type === 'switch'" role="menuitemcheckbox" :tabindex="i" class="_button" :class="[$style.item, $style.switch, { [$style.switchDisabled]: item.disabled } , { [$style.gamingDark]: gamingType === 'dark',[$style.gamingLight]: gamingType === 'light' }]" @click="switchItem(item)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
<MkSwitchButton :class="$style.switchButton" :checked="item.ref" :disabled="item.disabled" @toggle="switchItem(item)"/> <MkSwitchButton :class="$style.switchButton" :checked="item.ref" :disabled="item.disabled" @toggle="switchItem(item)" model-value/>
<span :class="$style.switchText">{{ item.text }}</span> <span :class="$style.switchText">{{ item.text }}</span>
</button> </button>
<button v-else-if="item.type === 'parent'" class="_button" role="menuitem" :tabindex="i" :class="[$style.item, $style.parent, { [$style.childShowing]: childShowingItem === item } , { [$style.gamingDark]: gamingType === 'dark',[$style.gamingLight]: gamingType === 'light' }]" @mouseenter="preferClick ? null : showChildren(item, $event)" @click="!preferClick ? null : showChildren(item, $event)"> <button v-else-if="item.type === 'parent'" class="_button" role="menuitem" :tabindex="i" :class="[$style.item, $style.parent, { [$style.childShowing]: childShowingItem === item } , { [$style.gamingDark]: gamingType === 'dark',[$style.gamingLight]: gamingType === 'light' }]" @mouseenter="preferClick ? null : showChildren(item, $event)" @click="!preferClick ? null : showChildren(item, $event)">
@ -69,7 +69,7 @@ import * as os from '@/os.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { isTouchUsing } from '@/scripts/touch.js'; import { isTouchUsing } from '@/scripts/touch.js';
import {defaultStore} from '@/store.js' import {defaultStore} from '@/store.js'
import MkSwitchButton from '@/components/MkSwitch.button.vue';
let gamingType = computed(defaultStore.makeGetterSetter('gamingType')); let gamingType = computed(defaultStore.makeGetterSetter('gamingType'));
const childrenCache = new WeakMap<MenuParent, MenuItem[]>(); const childrenCache = new WeakMap<MenuParent, MenuItem[]>();

View File

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<div :class="[$style.root, { [$style.disabled]: disabled && gamingType === '', [$style.checked]: checked && gamingType === '' }]"> <div :class="[$style.root, { [$style.disabled]: disabled , [$style.checked]: checked }]">
<input <input
ref="input" ref="input"
type="checkbox" type="checkbox"
@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
@keydown.enter="toggle" @keydown.enter="toggle"
> >
<XButton :checked="checked" :disabled="disabled" @toggle="toggle"/> <XButton :checked="checked" :disabled="disabled" @toggle="toggle"/>
<span :class="$style.body,{[$style.gamingDark]: gamingType === 'dark',[$style.gamingLight]: gamingType === 'light'}"> <span :class="[$style.body,{[$style.gamingDark]: gamingType === 'dark',[$style.gamingLight]: gamingType === 'light'}]">
<!-- TODO: 無名slotの方は廃止 --> <!-- TODO: 無名slotの方は廃止 -->
<span :class="$style.label"> <span :class="$style.label">
<span @click="toggle"> <span @click="toggle">
@ -30,7 +30,9 @@ SPDX-License-Identifier: AGPL-3.0-only
import {toRefs, Ref, ref, computed, watch} from 'vue'; import {toRefs, Ref, ref, computed, watch} from 'vue';
import XButton from '@/components/MkSwitch.button.vue'; import XButton from '@/components/MkSwitch.button.vue';
import {defaultStore} from "@/store.js"; import {defaultStore} from "@/store.js";
let gamingType = computed(defaultStore.makeGetterSetter('gamingType')); const gamingType = computed(defaultStore.makeGetterSetter('gamingType'));
console.log(gamingType.value)
const props = defineProps<{ const props = defineProps<{
modelValue: boolean | Ref<boolean>; modelValue: boolean | Ref<boolean>;

View File

@ -107,12 +107,6 @@ function connectChannel() {
withFiles: props.onlyFiles ? true : undefined, withFiles: props.onlyFiles ? true : undefined,
}); });
} else if (props.src === 'media') { } else if (props.src === 'media') {
endpoint = 'notes/hybrid-timeline';
query = {
withFiles: true,
withRenotes: props.withRenotes,
withReplies: props.withReplies,
};
connection = stream.useChannel('hybridTimeline', { connection = stream.useChannel('hybridTimeline', {
withFiles: true, withFiles: true,
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
@ -198,6 +192,13 @@ function updatePaginationQuery() {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined, withFiles: props.onlyFiles ? true : undefined,
}; };
}else if(props.src === 'media'){
endpoint = 'notes/hybrid-timeline';
query = {
withFiles: true,
withRenotes: props.withRenotes,
withReplies: props.withReplies,
};
} else if (props.src === 'mentions') { } else if (props.src === 'mentions') {
endpoint = 'notes/mentions'; endpoint = 'notes/mentions';
query = null; query = null;