Skip to content

Commit

Permalink
fix(frontend): タイムラインで、広告がない際にも広告のwrapperが出てしまうのを修正 (#14763)
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih authored Oct 13, 2024
1 parent 088e05e commit d0bb0b5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/frontend/src/components/MkDateSeparatedList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import MkAd from '@/components/global/MkAd.vue';
import { isDebuggerEnabled, stackTraceInstances } from '@/debug.js';
import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import { instance } from '@/instance.js';
import { defaultStore } from '@/store.js';
import { MisskeyEntity } from '@/types/date-separated-list.js';

Expand Down Expand Up @@ -99,10 +100,10 @@ export default defineComponent({

return [el, separator];
} else {
if (props.ad && item._shouldInsertAd_) {
if (props.ad && instance.ads.length > 0 && item._shouldInsertAd_) {
return [h('div', {
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, {
prefer: ['horizontal', 'horizontal-big'],
})]), el];
Expand Down Expand Up @@ -255,5 +256,11 @@ export default defineComponent({
.date-2-icon {
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>

0 comments on commit d0bb0b5

Please sign in to comment.