fix swipes?
This commit is contained in:
parent
04a7e9c147
commit
5e9d1ee478
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "12.118.1-calc.10.2",
|
"version": "12.118.1-calc.10.3",
|
||||||
"codename": "aqua",
|
"codename": "aqua",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -121,17 +121,6 @@ async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
||||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function chooseChannel(ev: MouseEvent): Promise<void> {
|
|
||||||
const channels = await os.api('channels/followed');
|
|
||||||
const items = channels.map((channel) => ({
|
|
||||||
type: 'link' as const,
|
|
||||||
text: channel.name,
|
|
||||||
indicate: channel.hasUnreadNote,
|
|
||||||
to: `/channels/${channel.id}`,
|
|
||||||
}));
|
|
||||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveSrc(
|
function saveSrc(
|
||||||
newSrc: 'home' | 'local' | 'recommended' | 'social' | 'global'
|
newSrc: 'home' | 'local' | 'recommended' | 'social' | 'global'
|
||||||
): void {
|
): void {
|
||||||
|
@ -269,24 +258,37 @@ if (isMobile.value) {
|
||||||
let xDiff = xDown - xUp;
|
let xDiff = xDown - xUp;
|
||||||
let yDiff = yDown - yUp;
|
let yDiff = yDown - yUp;
|
||||||
|
|
||||||
|
let next = 'home';
|
||||||
|
let timelines = ['home'];
|
||||||
|
|
||||||
|
if (isLocalTimelineAvailable) {
|
||||||
|
timelines.push('local');
|
||||||
|
}
|
||||||
|
if (isRecommendedTimelineAvailable) {
|
||||||
|
timelines.push('recommended');
|
||||||
|
}
|
||||||
|
if (isLocalTimelineAvailable) {
|
||||||
|
timelines.push('social');
|
||||||
|
}
|
||||||
|
if (isGlobalTimelineAvailable) {
|
||||||
|
timelines.push('global');
|
||||||
|
}
|
||||||
|
|
||||||
if (Math.abs(xDiff) > Math.abs(yDiff)) {
|
if (Math.abs(xDiff) > Math.abs(yDiff)) {
|
||||||
if (xDiff > 0) {
|
if (xDiff > 0) {
|
||||||
console.log('right swipe');
|
console.log('right swipe');
|
||||||
const current = headerTabs.values.find((x) => x.key === src.value);
|
next =
|
||||||
const next =
|
timelines[
|
||||||
headerTabs.values[
|
(timelines.indexOf(src) + 1) % timelines.length
|
||||||
(headerTabs.values.indexOf(current) + 1) % headerTabs.values.length
|
|
||||||
];
|
];
|
||||||
saveSrc(next.key);
|
|
||||||
} else {
|
} else {
|
||||||
console.log('left swipe');
|
console.log('left swipe');
|
||||||
const current = headerTabs.values.find((x) => x.key === src.value);
|
next =
|
||||||
const next =
|
timelines[
|
||||||
headerTabs.values[
|
(timelines.indexOf(src) + 1) % timelines.length
|
||||||
(headerTabs.values.indexOf(current) - 1) % headerTabs.values.length
|
|
||||||
];
|
];
|
||||||
saveSrc(next.key);
|
|
||||||
}
|
}
|
||||||
|
saveSrc(next);
|
||||||
} /* else {
|
} /* else {
|
||||||
if (yDiff > 0) {
|
if (yDiff > 0) {
|
||||||
// down swipe
|
// down swipe
|
||||||
|
|
Loading…
Reference in New Issue