mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-30 15:58:19 +09:00
lint
This commit is contained in:
parent
904e3d0b8a
commit
7c8cd8bd9c
@ -10,8 +10,8 @@ import type { Packed } from '@/misc/json-schema.js';
|
||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import Channel from '../channel.js';
|
||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||
import Channel from '../channel.js';
|
||||
|
||||
class ChannelChannel extends Channel {
|
||||
public readonly chName = 'channel';
|
||||
|
@ -11,8 +11,8 @@ import { MessagingService } from '@/core/MessagingService.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import Channel from '../channel.js';
|
||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||
import Channel from '../channel.js';
|
||||
|
||||
class MessagingChannel extends Channel {
|
||||
public readonly chName = 'messaging';
|
||||
|
@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</div>
|
||||
<div :class="$style.section">
|
||||
<div :class="$style.info">
|
||||
<span v-if="note.updatedAt" style="margin-right: 0.5em;" :title="i18n.ts.edited"><i class="ti ti-pencil"></i></span>
|
||||
<span v-if="note.updatedAt" style="margin-right: 0.5em;" :title="i18n.ts.edited"><i class="ti ti-pencil"></i></span>
|
||||
<span v-if="note.visibility !== 'public'" style="margin-right: 0.5em;">
|
||||
<i v-if="note.visibility === 'home'" v-tooltip="i18n.ts._visibility[note.visibility]" class="ti ti-home"></i>
|
||||
<i v-else-if="note.visibility === 'followers'" v-tooltip="i18n.ts._visibility[note.visibility]" class="ti ti-lock"></i>
|
||||
|
@ -776,7 +776,7 @@ async function post(ev?: MouseEvent) {
|
||||
visibleUserIds: visibility === 'specified' ? visibleUsers.map(u => u.id) : undefined,
|
||||
reactionAcceptance,
|
||||
disableRightClick: disableRightClick,
|
||||
noteId: props.updateMode ? props.initialNote?.id : undefined,
|
||||
noteId: props.updateMode ? props.initialNote?.id : undefined,
|
||||
};
|
||||
|
||||
if (withHashtags && hashtags && hashtags.trim() !== '') {
|
||||
@ -892,10 +892,10 @@ function showActions(ev) {
|
||||
action: () => {
|
||||
action.handler({
|
||||
text: text,
|
||||
cw: cw,
|
||||
cw: cw,
|
||||
}, (key, value) => {
|
||||
if (key === 'text') { text = value; }
|
||||
if (key === 'cw') { useCw = value !== null; cw = value; }
|
||||
if (key === 'cw') { useCw = value !== null; cw = value; }
|
||||
});
|
||||
},
|
||||
})), ev.currentTarget ?? ev.target);
|
||||
|
@ -35,7 +35,7 @@ const props = withDefaults(defineProps<{
|
||||
withRenotes: true,
|
||||
withReplies: false,
|
||||
onlyFiles: false,
|
||||
onlyCats: false,
|
||||
onlyCats: false,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
@ -95,13 +95,13 @@ if (props.src === 'antenna') {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
connection = stream.useChannel('homeTimeline', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
||||
@ -116,13 +116,13 @@ if (props.src === 'antenna') {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
connection = stream.useChannel('localTimeline', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
||||
@ -135,13 +135,13 @@ if (props.src === 'antenna') {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
connection = stream.useChannel('hybridTimeline', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
||||
@ -154,13 +154,13 @@ if (props.src === 'antenna') {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
connection = stream.useChannel('globalTimeline', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
||||
@ -189,14 +189,14 @@ if (props.src === 'antenna') {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
listId: props.list,
|
||||
};
|
||||
connection = stream.useChannel('userList', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
listId: props.list,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template>
|
||||
<MkStickyContainer>
|
||||
<template #header>
|
||||
<XHeader :actions="headerActions" :tabs="headerTabs" />
|
||||
<XHeader :actions="headerActions" :tabs="headerTabs"/>
|
||||
</template>
|
||||
<MkSpacer :contentMax="900">
|
||||
<MkSwitch :modelValue="publishing" @update:modelValue="onChangePublishing">
|
||||
@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</MkSwitch>
|
||||
<div>
|
||||
<div v-for="ad in ads" class="_panel _gaps_m" :class="$style.ad">
|
||||
<MkAd v-if="ad.url" :specify="ad" />
|
||||
<MkAd v-if="ad.url" :specify="ad"/>
|
||||
<MkInput v-model="ad.url" type="url">
|
||||
<template #label>URL</template>
|
||||
</MkInput>
|
||||
@ -51,8 +51,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<span>
|
||||
{{ i18n.ts._ad.timezoneinfo }}
|
||||
<div v-for="(day, index) in daysOfWeek" :key="index">
|
||||
<input :id="`ad${ad.id}-${index}`" type="checkbox" :checked="(ad.dayOfWeek & (1 << index)) !== 0"
|
||||
@change="toggleDayOfWeek(ad, index)">
|
||||
<input :id="`ad${ad.id}-${index}`" type="checkbox" :checked="(ad.dayOfWeek & (1 << index)) !== 0" @change="toggleDayOfWeek(ad, index)">
|
||||
<label :for="`ad${ad.id}-${index}`">{{ day }}</label>
|
||||
</div>
|
||||
</span>
|
||||
@ -61,9 +60,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #label>{{ i18n.ts.memo }}</template>
|
||||
</MkTextarea>
|
||||
<div class="buttons">
|
||||
<MkButton class="button" inline primary style="margin-right: 12px;" @click="save(ad)"><i
|
||||
class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
|
||||
<MkButton class="button" inline danger @click="remove(ad)"><i class="ti ti-trash"></i> {{ i18n.ts.remove }}
|
||||
<MkButton class="button" inline primary style="margin-right: 12px;" @click="save(ad)">
|
||||
<i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}
|
||||
</MkButton>
|
||||
<MkButton class="button" inline danger @click="remove(ad)">
|
||||
<i class="ti ti-trash"></i> {{ i18n.ts.remove }}
|
||||
</MkButton>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
:onlyFiles="onlyFiles"
|
||||
:onlyCats="onlyCats"
|
||||
:onlyCats="onlyCats"
|
||||
:sound="true"
|
||||
@queue="queueUpdated"
|
||||
/>
|
||||
@ -106,10 +106,10 @@ watch($$(src), () => {
|
||||
});
|
||||
|
||||
watch([
|
||||
friendlyEnableNotifications,
|
||||
friendlyEnableWidgets,
|
||||
friendlyEnableNotifications,
|
||||
friendlyEnableWidgets,
|
||||
], async () => {
|
||||
await reloadAsk();
|
||||
await reloadAsk();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
@ -200,47 +200,47 @@ async function reloadAsk() {
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => [{
|
||||
icon: 'ti ti-dots',
|
||||
text: i18n.ts.options,
|
||||
handler: (ev) => {
|
||||
os.popupMenu([{
|
||||
type: 'switch',
|
||||
text: i18n.ts.friendlyEnableNotifications,
|
||||
icon: 'ti ti-notification',
|
||||
ref: friendlyEnableNotifications,
|
||||
action: () => {
|
||||
friendlyEnableNotifications.value = !friendlyEnableNotifications.value;
|
||||
},
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.friendlyEnableWidgets,
|
||||
icon: 'ti ti-apps',
|
||||
ref: friendlyEnableWidgets,
|
||||
action: () => {
|
||||
friendlyEnableWidgets.value = !friendlyEnableWidgets.value;
|
||||
},
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
icon: 'ti ti-repeat',
|
||||
ref: $$(withRenotes),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.withReplies,
|
||||
icon: 'ti ti-arrow-back-up',
|
||||
ref: $$(withReplies),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.fileAttachedOnly,
|
||||
icon: 'ti ti-photo',
|
||||
ref: $$(onlyFiles),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showCatOnly,
|
||||
icon: 'ti ti-cat',
|
||||
ref: $$(onlyCats),
|
||||
}], ev.currentTarget ?? ev.target);
|
||||
},
|
||||
icon: 'ti ti-dots',
|
||||
text: i18n.ts.options,
|
||||
handler: (ev) => {
|
||||
os.popupMenu([{
|
||||
type: 'switch',
|
||||
text: i18n.ts.friendlyEnableNotifications,
|
||||
icon: 'ti ti-notification',
|
||||
ref: friendlyEnableNotifications,
|
||||
action: () => {
|
||||
friendlyEnableNotifications.value = !friendlyEnableNotifications.value;
|
||||
},
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.friendlyEnableWidgets,
|
||||
icon: 'ti ti-apps',
|
||||
ref: friendlyEnableWidgets,
|
||||
action: () => {
|
||||
friendlyEnableWidgets.value = !friendlyEnableWidgets.value;
|
||||
},
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
icon: 'ti ti-repeat',
|
||||
ref: $$(withRenotes),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.withReplies,
|
||||
icon: 'ti ti-arrow-back-up',
|
||||
ref: $$(withReplies),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.fileAttachedOnly,
|
||||
icon: 'ti ti-photo',
|
||||
ref: $$(onlyFiles),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showCatOnly,
|
||||
icon: 'ti ti-cat',
|
||||
ref: $$(onlyCats),
|
||||
}], ev.currentTarget ?? ev.target);
|
||||
},
|
||||
}]);
|
||||
|
||||
const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({
|
||||
|
@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
:onlyFiles="onlyFiles"
|
||||
:onlyCats="onlyCats"
|
||||
:onlyCats="onlyCats"
|
||||
/>
|
||||
</XColumn>
|
||||
</template>
|
||||
@ -76,9 +76,9 @@ watch($$(onlyFiles), v => {
|
||||
});
|
||||
|
||||
watch($$(onlyCats), v => {
|
||||
updateColumn(props.column.id, {
|
||||
onlyCats: v,
|
||||
});
|
||||
updateColumn(props.column.id, {
|
||||
onlyCats: v,
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
@ -132,9 +132,9 @@ const menu = [{
|
||||
text: i18n.ts.fileAttachedOnly,
|
||||
ref: $$(onlyFiles),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showCatOnly,
|
||||
ref: $$(onlyCats),
|
||||
type: 'switch',
|
||||
text: i18n.ts.showCatOnly,
|
||||
ref: $$(onlyCats),
|
||||
}];
|
||||
</script>
|
||||
|
||||
|
@ -77,12 +77,12 @@ globalThis.addEventListener('push', ev => {
|
||||
break;
|
||||
case 'readAllMessagingMessages':
|
||||
for (const n of await globalThis.registration.getNotifications()) {
|
||||
if (n?.data?.type === 'unreadMessagingMessage') n.close();
|
||||
if (n.data?.type === 'unreadMessagingMessage') n.close();
|
||||
}
|
||||
break;
|
||||
case 'readAllMessagingMessagesOfARoom':
|
||||
for (const n of await globalThis.registration.getNotifications()) {
|
||||
if (n?.data?.type === 'unreadMessagingMessage'
|
||||
if (n.data?.type === 'unreadMessagingMessage'
|
||||
&& ('userId' in data.body
|
||||
? data.body.userId === n.data.body.userId
|
||||
: data.body.groupId === n.data.body.groupId)
|
||||
|
Loading…
Reference in New Issue
Block a user