Merge branch 'notification-read-api' into swn

This commit is contained in:
tamaina 2021-12-05 12:47:24 +09:00
commit 4a8dfbdf2d
95 changed files with 1935 additions and 1162 deletions

View file

@ -109,6 +109,14 @@ export function getUserMenu(user) {
return !confirm.canceled;
}
async function invalidateFollow() {
os.apiWithDialog('following/invalidate', {
userId: user.id
}).then(() => {
user.isFollowed = !user.isFollowed;
})
}
let menu = [{
icon: 'fas fa-at',
text: i18n.locale.copyUsername,
@ -153,6 +161,14 @@ export function getUserMenu(user) {
action: toggleBlock
}]);
if (user.isFollowed) {
menu = menu.concat([{
icon: 'fas fa-unlink',
text: i18n.locale.breakFollow,
action: invalidateFollow
}]);
}
menu = menu.concat([null, {
icon: 'fas fa-exclamation-circle',
text: i18n.locale.reportAbuse,

View file

@ -1,5 +1,6 @@
import { isScreenTouching } from '@/os';
import { Ref, ref } from 'vue';
import { isDeviceTouch } from './is-device-touch';
export function useTooltip(onShow: (showing: Ref<boolean>) => void) {
let isHovering = false;
@ -13,7 +14,7 @@ export function useTooltip(onShow: (showing: Ref<boolean>) => void) {
// iOS(Androidも)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、その対策
// これが無いと、画面に触れてないのにツールチップが出たりしてしまう
if (!isScreenTouching) return;
if (isDeviceTouch && !isScreenTouching) return;
const showing = ref(true);
onShow(showing);