fix(frontend): タイムラインで、広告がない際にも広告のwrapperが出てしまうのを修正 (#14763)
This commit is contained in:
parent
088e05ea66
commit
d0bb0b51f5
1 changed files with 9 additions and 2 deletions
|
@ -9,6 +9,7 @@ import MkAd from '@/components/global/MkAd.vue';
|
||||||
import { isDebuggerEnabled, stackTraceInstances } from '@/debug.js';
|
import { isDebuggerEnabled, stackTraceInstances } from '@/debug.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { instance } from '@/instance.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { MisskeyEntity } from '@/types/date-separated-list.js';
|
import { MisskeyEntity } from '@/types/date-separated-list.js';
|
||||||
|
|
||||||
|
@ -99,10 +100,10 @@ export default defineComponent({
|
||||||
|
|
||||||
return [el, separator];
|
return [el, separator];
|
||||||
} else {
|
} else {
|
||||||
if (props.ad && item._shouldInsertAd_) {
|
if (props.ad && instance.ads.length > 0 && item._shouldInsertAd_) {
|
||||||
return [h('div', {
|
return [h('div', {
|
||||||
key: item.id + ':ad',
|
key: item.id + ':ad',
|
||||||
style: 'padding: 8px; background-size: auto auto; background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--MI_THEME-bg) 8px, var(--MI_THEME-bg) 14px );',
|
class: $style['ad-wrapper'],
|
||||||
}, [h(MkAd, {
|
}, [h(MkAd, {
|
||||||
prefer: ['horizontal', 'horizontal-big'],
|
prefer: ['horizontal', 'horizontal-big'],
|
||||||
})]), el];
|
})]), el];
|
||||||
|
@ -255,5 +256,11 @@ export default defineComponent({
|
||||||
.date-2-icon {
|
.date-2-icon {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ad-wrapper {
|
||||||
|
padding: 8px;
|
||||||
|
background-size: auto auto;
|
||||||
|
background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--MI_THEME-bg) 8px, var(--MI_THEME-bg) 14px);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue