tab swipe fix

This commit is contained in:
ThatOneCalculator 2022-10-25 19:19:42 -07:00
parent e93f0939bd
commit bf2b518489
6 changed files with 18 additions and 36 deletions

View File

@ -102,12 +102,9 @@ import 'swiper/scss/virtual';
let tabs = ['overview']; let tabs = ['overview'];
if (iAmModerator) tabs.push('ip'); if (iAmModerator) tabs.push('ip');
tabs.push('raw'); tabs.push('raw');
let tab = $computed({ let tab = $ref(tabs[0]);
get: () => tabs[0], watch($$(tab), () => (syncSlide(tabs.indexOf(tab))));
set: (x) => {
syncSlide(tabs.indexOf(x));
},
});
let file: any = $ref(null); let file: any = $ref(null);
let info: any = $ref(null); let info: any = $ref(null);
let isSensitive: boolean = $ref(false); let isSensitive: boolean = $ref(false);

View File

@ -55,12 +55,9 @@ import 'swiper/scss/virtual';
const router = useRouter(); const router = useRouter();
const tabs = ['featured', 'following', 'owned']; const tabs = ['featured', 'following', 'owned'];
let tab = $computed({ let tab = $ref(tabs[0]);
get: () => tabs[0], watch($$(tab), () => (syncSlide(tabs.indexOf(tab))));
set: (x) => {
syncSlide(tabs.indexOf(x));
},
});
const featuredPagination = { const featuredPagination = {
endpoint: 'channels/featured' as const, endpoint: 'channels/featured' as const,

View File

@ -70,12 +70,9 @@ const props = defineProps<{
}>(); }>();
const tabs = ['explore', 'liked', 'my']; const tabs = ['explore', 'liked', 'my'];
let tab = $computed({ let tab = $ref(tabs[0]);
get: () => tabs[0], watch($$(tab), () => (syncSlide(tabs.indexOf(tab))));
set: (x) => {
syncSlide(tabs.indexOf(x));
},
});
let tagsRef = $ref(); let tagsRef = $ref();
const recentPostsPagination = { const recentPostsPagination = {

View File

@ -164,12 +164,9 @@ const props = defineProps<{
let tabs = ['overview']; let tabs = ['overview'];
if (iAmModerator) tabs.push('chart', 'users', 'raw'); if (iAmModerator) tabs.push('chart', 'users', 'raw');
let tab = $computed({ let tab = $ref(tabs[0]);
get: () => tabs[0], watch($$(tab), () => (syncSlide(tabs.indexOf(tab))));
set: (x) => {
syncSlide(tabs.indexOf(x));
},
});
let chartSrc = $ref('instance-requests'); let chartSrc = $ref('instance-requests');
let meta = $ref<misskey.entities.DetailedInstanceMetadata | null>(null); let meta = $ref<misskey.entities.DetailedInstanceMetadata | null>(null);
let instance = $ref<misskey.entities.Instance | null>(null); let instance = $ref<misskey.entities.Instance | null>(null);

View File

@ -50,12 +50,9 @@ import 'swiper/scss';
import 'swiper/scss/virtual'; import 'swiper/scss/virtual';
const tabs = ['all', 'unread', 'mentions', 'directNotes']; const tabs = ['all', 'unread', 'mentions', 'directNotes'];
let tab = $computed({ let tab = $ref(tabs[0]);
get: () => tabs[0], watch($$(tab), () => (syncSlide(tabs.indexOf(tab))));
set: (x) => {
syncSlide(tabs.indexOf(x));
},
});
let includeTypes = $ref<string[] | null>(null); let includeTypes = $ref<string[] | null>(null);
let unreadOnly = $computed(() => tab === 'unread'); let unreadOnly = $computed(() => tab === 'unread');
os.api('notifications/mark-all-as-read'); os.api('notifications/mark-all-as-read');

View File

@ -75,12 +75,9 @@ if (($i && ($i.id === user?.id)) || user?.publicReactions) {
if ((user?.instance != null)) { if ((user?.instance != null)) {
tabs.push('clips', 'pages', 'gallery'); tabs.push('clips', 'pages', 'gallery');
} }
let tab = $computed({ let tab = $ref(tabs[0]);
get: () => tabs[0], watch($$(tab), () => (syncSlide(tabs.indexOf(tab))));
set: (x) => {
syncSlide(tabs.indexOf(x));
},
});
let error = $ref(null); let error = $ref(null);
function fetchUser(): void { function fetchUser(): void {