Storage improve (#6976)

* wip

* wip

* wip

* wip

* wip

* Update storage.ts

* wip

* wip

* wip

* wip

* Update storage.ts

* Update storage.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update storage.ts

* wip

* wip

* wip

* wip

* 🍕

* wip

* wip

* wip

* wip

* wip

* wip

* Update deck-storage.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update store.ts

* wip

* wip

* wip

* wip

* Update init.ts

* wip

* wip

* Update pizzax.ts

* wip

* wip

* Update timeline.vue

* Update init.ts

* wip

* wip

* Update init.ts
This commit is contained in:
syuilo
2020-12-19 10:55:52 +09:00
committed by GitHub
parent 57d0c19a98
commit 43930e6a84
146 changed files with 1458 additions and 1519 deletions

View File

@ -116,16 +116,6 @@ export default defineComponent({
}
};
update();
this.$store.subscribe((mutation, state) => {
if (mutation.type !== 'device/set') return;
if (mutation?.payload?.key !== 'theme') return;
setTimeout(() => {
this.computedStyle = getComputedStyle(document.documentElement);
}, 250);
});
},
beforeUnmount() {

View File

@ -17,8 +17,8 @@
</ol>
<ol class="emojis" ref="suggests" v-if="emojis.length > 0">
<li v-for="emoji in emojis" @click="complete(type, emoji.emoji)" @keydown="onKeydown" tabindex="-1">
<span class="emoji" v-if="emoji.isCustomEmoji"><img :src="$store.state.device.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url" :alt="emoji.emoji"/></span>
<span class="emoji" v-else-if="!useOsNativeEmojis"><img :src="emoji.url" :alt="emoji.emoji"/></span>
<span class="emoji" v-if="emoji.isCustomEmoji"><img :src="$store.state.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url" :alt="emoji.emoji"/></span>
<span class="emoji" v-else-if="!$store.state.useOsNativeEmojis"><img :src="emoji.url" :alt="emoji.emoji"/></span>
<span class="emoji" v-else>{{ emoji.emoji }}</span>
<span class="name" v-html="emoji.name.replace(q, `<b>${q}</b>`)"></span>
<span class="alias" v-if="emoji.aliasOf">({{ emoji.aliasOf }})</span>
@ -128,12 +128,6 @@ export default defineComponent({
}
},
computed: {
useOsNativeEmojis(): boolean {
return this.$store.state.device.useOsNativeEmojis;
}
},
watch: {
showing() {
if (!this.showing) {
@ -151,7 +145,7 @@ export default defineComponent({
this.setPosition();
//#region Construct Emoji DB
const customEmojis = this.$store.state.instance.meta.emojis;
const customEmojis = this.$instance.emojis;
const emojiDefinitions: EmojiDef[] = [];
for (const x of customEmojis) {

View File

@ -28,7 +28,6 @@ declare global {
interface Window extends CaptchaContainer {
}
}
import * as os from '@/os';
export default defineComponent({
props: {
@ -101,7 +100,7 @@ export default defineComponent({
if (this.captcha.render && this.$refs.captcha instanceof Element) {
this.captcha.render(this.$refs.captcha, {
sitekey: this.sitekey,
theme: this.$store.state.device.darkMode ? 'dark' : 'light',
theme: this.$store.state.darkMode ? 'dark' : 'light',
callback: this.callback,
'expired-callback': this.callback,
'error-callback': this.callback,

View File

@ -37,12 +37,14 @@ export default defineComponent({
});
}
return h(this.$store.state.device.animation ? TransitionGroup : 'div', {
return h(this.$store.state.animation ? TransitionGroup : 'div', this.$store.state.animation ? {
class: 'sqadhkmv _list_',
name: 'list',
tag: 'div',
'data-direction': this.direction,
'data-reversed': this.reversed ? 'true' : 'false',
} : {
class: 'sqadhkmv _list_',
}, this.items.map((item, i) => {
const el = this.$slots.default({
item: item

View File

@ -27,6 +27,7 @@ import {
faFilm
} from '@fortawesome/free-solid-svg-icons';
import ImgWithBlurhash from './img-with-blurhash.vue';
import { ColdDeviceStorage } from '@/store';
export default defineComponent({
components: {
@ -89,12 +90,12 @@ export default defineComponent({
},
mounted() {
const audioTag = this.$refs.volumectrl as HTMLAudioElement;
if (audioTag) audioTag.volume = this.$store.state.device.mediaVolume;
if (audioTag) audioTag.volume = ColdDeviceStorage.get('mediaVolume');
},
methods: {
volumechange() {
const audioTag = this.$refs.volumectrl as HTMLAudioElement;
this.$store.commit('device/set', { key: 'mediaVolume', value: audioTag.volume });
ColdDeviceStorage.set('mediaVolume', audioTag.volume);
}
}
});

View File

@ -8,11 +8,11 @@
@dragend="onDragend"
:title="title"
>
<div class="label" v-if="$store.state.i.avatarId == file.id">
<div class="label" v-if="$i.avatarId == file.id">
<img src="/assets/label.svg"/>
<p>{{ $t('avatar') }}</p>
</div>
<div class="label" v-if="$store.state.i.bannerId == file.id">
<div class="label" v-if="$i.bannerId == file.id">
<img src="/assets/label.svg"/>
<p>{{ $t('banner') }}</p>
</div>

View File

@ -19,7 +19,7 @@
<template v-if="!hover"><Fa :icon="faFolder" fixed-width/></template>
{{ folder.name }}
</p>
<p class="upload" v-if="$store.state.settings.uploadFolder == folder.id">
<p class="upload" v-if="$store.state.uploadFolder == folder.id">
{{ $t('uploadFolder') }}
</p>
<button v-if="selectMode" class="checkbox _button" :class="{ checked: isSelected }" @click.prevent.stop="checkboxClicked"></button>
@ -213,11 +213,8 @@ export default defineComponent({
os.api('drive/folders/delete', {
folderId: this.folder.id
}).then(() => {
if (this.$store.state.settings.uploadFolder === this.folder.id) {
this.$store.dispatch('settings/set', {
key: 'uploadFolder',
value: null
});
if (this.$store.state.uploadFolder === this.folder.id) {
this.$store.set('uploadFolder', null);
}
}).catch(err => {
switch(err.id) {
@ -238,10 +235,7 @@ export default defineComponent({
},
setAsUploadFolder() {
this.$store.dispatch('settings/set', {
key: 'uploadFolder',
value: this.folder.id
});
this.$store.set('uploadFolder', this.folder.id);
},
onContextmenu(e) {

View File

@ -136,7 +136,7 @@ export default defineComponent({
},
mounted() {
if (this.$store.state.device.enableInfiniteScroll && this.$refs.loadMoreFiles) {
if (this.$store.state.enableInfiniteScroll && this.$refs.loadMoreFiles) {
this.$nextTick(() => {
this.ilFilesObserver.observe((this.$refs.loadMoreFiles as Vue).$el)
});
@ -159,7 +159,7 @@ export default defineComponent({
},
activated() {
if (this.$store.state.device.enableInfiniteScroll) {
if (this.$store.state.enableInfiniteScroll) {
this.$nextTick(() => {
this.ilFilesObserver.observe((this.$refs.loadMoreFiles as Vue).$el)
});

View File

@ -13,7 +13,7 @@
tabindex="0"
>
<MkEmoji v-if="emoji.char != null" :emoji="emoji.char"/>
<img v-else :src="$store.state.device.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
<img v-else :src="$store.state.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
</button>
</div>
<div v-if="searchResultUnicode.length > 0">
@ -45,7 +45,7 @@
<section>
<header class="_acrylic"><Fa :icon="faClock" fixed-width/> {{ $t('recentUsed') }}</header>
<div>
<button v-for="emoji in $store.state.device.recentlyUsedEmojis"
<button v-for="emoji in $store.state.recentlyUsedEmojis"
class="_button"
@click="chosen(emoji, $event)"
:key="emoji"
@ -67,7 +67,7 @@
@click="chosen(emoji, $event)"
:key="emoji.name"
>
<img :src="$store.state.device.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
<img :src="$store.state.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
</button>
</div>
</section>
@ -100,6 +100,7 @@ import MkModal from '@/components/ui/modal.vue';
import Particle from '@/components/particle.vue';
import * as os from '@/os';
import { isDeviceTouch } from '../scripts/is-device-touch';
import { emojiCategories } from '@/instance';
export default defineComponent({
components: {
@ -125,12 +126,12 @@ export default defineComponent({
return {
emojilist: markRaw(emojilist),
getStaticImageUrl,
pinned: this.$store.state.settings.reactions,
width: this.asReactionPicker ? this.$store.state.device.reactionPickerWidth : 3,
height: this.asReactionPicker ? this.$store.state.device.reactionPickerHeight : 2,
pinned: this.$store.state.reactions,
width: this.asReactionPicker ? this.$store.state.reactionPickerWidth : 3,
height: this.asReactionPicker ? this.$store.state.reactionPickerHeight : 2,
big: this.asReactionPicker ? isDeviceTouch : false,
customEmojiCategories: this.$store.getters['instance/emojiCategories'],
customEmojis: this.$store.state.instance.meta.emojis,
customEmojiCategories: emojiCategories,
customEmojis: this.$instance.emojis,
visibleCategories: {},
q: null,
searchResultCustom: [],
@ -346,10 +347,10 @@ export default defineComponent({
// 最近使った絵文字更新
if (!this.pinned.includes(key)) {
let recents = this.$store.state.device.recentlyUsedEmojis;
let recents = this.$store.state.recentlyUsedEmojis;
recents = recents.filter((e: any) => e !== key);
recents.unshift(key);
this.$store.commit('device/set', { key: 'recentlyUsedEmojis', value: recents.splice(0, 16) });
this.$store.set('recentlyUsedEmojis', recents.splice(0, 16));
}
},

View File

@ -12,6 +12,7 @@
._formLabel {
font-size: 80%;
padding: 0 16px 8px 16px;
opacity: 0.8;
&:empty {
display: none;
@ -21,6 +22,7 @@
._formCaption {
font-size: 80%;
padding: 8px 16px 0 16px;
opacity: 0.8;
&:empty {
display: none;

View File

@ -12,6 +12,7 @@ import copyToClipboard from '@/scripts/copy-to-clipboard';
import { router } from '@/router';
import { ui, url } from '@/config';
import { popout } from '@/scripts/popout';
import { ColdDeviceStorage } from '@/store';
export default defineComponent({
inject: {
@ -98,8 +99,8 @@ export default defineComponent({
nav() {
if (this.to.startsWith('/my/messaging')) {
if (this.$store.state.device.chatOpenBehavior === 'window') return this.window();
if (this.$store.state.device.chatOpenBehavior === 'popout') return this.popout();
if (ColdDeviceStorage.get('chatOpenBehavior') === 'window') return this.window();
if (ColdDeviceStorage.get('chatOpenBehavior') === 'popout') return this.popout();
}
if (this.behavior) {
@ -111,12 +112,13 @@ export default defineComponent({
if (this.navHook) {
this.navHook(this.to);
} else {
if (this.$store.state.device.defaultSideView && this.sideViewHook && this.to !== '/') {
if (this.$store.state.defaultSideView && this.sideViewHook && this.to !== '/') {
return this.sideViewHook(this.to);
}
if (this.$store.state.device.deckNavWindow && (ui === 'deck') && this.to !== '/') {
return this.window();
}
// TODO: a.vueからdeck-sotreを参照したくないのでなんとかする
//if (deckStore.state.device.deckNavWindow && (ui === 'deck') && this.to !== '/') {
// return this.window();
//}
if (ui === 'desktop') {
return this.window();
}

View File

@ -1,7 +1,7 @@
<template>
<span class="mk-acct" v-once>
<span class="name">@{{ user.username }}</span>
<span class="host" v-if="user.host || detail || $store.state.settings.showFullAcct">@{{ user.host || host }}</span>
<span class="host" v-if="user.host || detail || $store.state.showFullAcct">@{{ user.host || host }}</span>
</span>
</template>

View File

@ -38,7 +38,7 @@ export default defineComponent({
return this.user.isCat;
},
url(): string {
return this.$store.state.device.disableShowingAnimatedImages
return this.$store.state.disableShowingAnimatedImages
? getStaticImageUrl(this.user.avatarUrl)
: this.user.avatarUrl;
},

View File

@ -54,13 +54,13 @@ export default defineComponent({
},
useOsNativeEmojis(): boolean {
return this.$store.state.device.useOsNativeEmojis && !this.isReaction;
return this.$store.state.useOsNativeEmojis && !this.isReaction;
},
ce() {
let ce = [];
if (this.customEmojis) ce = ce.concat(this.customEmojis);
if (this.$store.state.instance.meta && this.$store.state.instance.meta.emojis) ce = ce.concat(this.$store.state.instance.meta.emojis);
if (this.$instance && this.$instance.emojis) ce = ce.concat(this.$instance.emojis);
return ce;
}
},
@ -72,7 +72,7 @@ export default defineComponent({
const customEmoji = this.ce.find(x => x.name === this.emoji.substr(1, this.emoji.length - 2));
if (customEmoji) {
this.customEmoji = customEmoji;
this.url = this.$store.state.device.disableShowingAnimatedImages
this.url = this.$store.state.disableShowingAnimatedImages
? getStaticImageUrl(customEmoji.url)
: customEmoji.url;
}

View File

@ -1,5 +1,5 @@
<template>
<transition :name="$store.state.device.animation ? 'zoom' : ''" appear>
<transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div class="mjndxjcg">
<img src="https://xn--931a.moe/assets/error.jpg" class="_ghost"/>
<p><Fa :icon="faExclamationTriangle"/> {{ $t('somethingHappened') }}</p>

View File

@ -23,7 +23,7 @@ export default defineComponent({
},
methods: {
search() {
const engine = this.$store.state.settings.webSearchEngine ||
const engine = this.$store.state.webSearchEngine ||
'https://www.google.com/search?q={{query}}';
const url = engine.replace('{{query}}', this.query)
window.open(url, '_blank');

View File

@ -278,7 +278,7 @@ export default defineComponent({
}
// TODO: var(--panel)の色が暗いか明るいかで判定する
const gridColor = this.$store.state.device.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)';
const gridColor = this.$store.state.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)';
Chart.defaults.global.defaultFontColor = getComputedStyle(document.documentElement).getPropertyValue('--fg');
this.chartInstance = markRaw(new Chart(this.$refs.chart, {

View File

@ -58,7 +58,7 @@ export default defineComponent({
computed: {
menu(): string[] {
return this.$store.state.deviceUser.menu;
return this.$store.state.menu;
},
},

View File

@ -29,6 +29,7 @@
import { defineComponent } from 'vue';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import * as os from '@/os';
import { ColdDeviceStorage } from '@/store';
export default defineComponent({
props: {
@ -45,12 +46,12 @@ export default defineComponent({
},
mounted() {
const audioTag = this.$refs.audio as HTMLAudioElement;
if (audioTag) audioTag.volume = this.$store.state.device.mediaVolume;
if (audioTag) audioTag.volume = ColdDeviceStorage.get('mediaVolume');
},
methods: {
volumechange() {
const audioTag = this.$refs.audio as HTMLAudioElement;
this.$store.commit('device/set', { key: 'mediaVolume', value: audioTag.volume });
ColdDeviceStorage.set('mediaVolume', audioTag.volume);
},
},
})

View File

@ -52,13 +52,11 @@ export default defineComponent({
},
computed: {
url(): any {
let url = this.$store.state.device.disableShowingAnimatedImages
let url = this.$store.state.disableShowingAnimatedImages
? getStaticImageUrl(this.image.thumbnailUrl)
: this.image.thumbnailUrl;
if (this.$store.state.device.loadRemoteMedia) {
url = null;
} else if (this.raw || this.$store.state.device.loadRawImages) {
if (this.raw || this.$store.state.loadRawImages) {
url = this.image.url;
}
@ -68,7 +66,7 @@ export default defineComponent({
created() {
// Plugin:register_note_view_interruptor を使って書き換えられる可能性があるためwatchする
this.$watch('image', () => {
this.hide = (this.$store.state.device.nsfw === 'force') ? true : this.image.isSensitive && (this.$store.state.device.nsfw !== 'ignore');
this.hide = (this.$store.state.nsfw === 'force') ? true : this.image.isSensitive && (this.$store.state.nsfw !== 'ignore');
if (this.image.blurhash) {
this.color = extractAvgColorFromBlurhash(this.image.blurhash);
}
@ -79,7 +77,7 @@ export default defineComponent({
},
methods: {
onClick() {
if (this.$store.state.device.imageNewTab) {
if (this.$store.state.imageNewTab) {
window.open(this.image.url, '_blank');
} else {
os.popup(ImageViewer, {

View File

@ -48,7 +48,7 @@ export default defineComponent({
}
},
created() {
this.hide = (this.$store.state.device.nsfw === 'force') ? true : this.video.isSensitive && (this.$store.state.device.nsfw !== 'ignore');
this.hide = (this.$store.state.nsfw === 'force') ? true : this.video.isSensitive && (this.$store.state.nsfw !== 'ignore');
},
});
</script>

View File

@ -3,7 +3,7 @@
<span class="me" v-if="isMe">{{ $t('you') }}</span>
<span class="main">
<span class="username">@{{ username }}</span>
<span class="host" v-if="(host != localHost) || $store.state.settings.showFullAcct">@{{ toUnicode(host) }}</span>
<span class="host" v-if="(host != localHost) || $store.state.showFullAcct">@{{ toUnicode(host) }}</span>
</span>
</MkA>
<a class="ldlomzub" :href="url" target="_blank" rel="noopener" v-else>
@ -50,8 +50,8 @@ export default defineComponent({
return this.host === localHost ? `@${this.username}` : `@${this.username}@${toUnicode(this.host)}`;
},
isMe(): boolean {
return this.$store.getters.isSignedIn && (
`@${this.username}@${toUnicode(this.host)}` === `@${this.$store.state.i.username}@${toUnicode(localHost)}`.toLowerCase()
return this.$i && (
`@${this.username}@${toUnicode(this.host)}` === `@${this.$i.username}@${toUnicode(localHost)}`.toLowerCase()
);
}
},

View File

@ -82,22 +82,22 @@ export default defineComponent({
let style;
switch (token.node.props.name) {
case 'tada': {
style = `font-size: 150%;` + (this.$store.state.device.animatedMfm ? 'animation: tada 1s linear infinite both;' : '');
style = `font-size: 150%;` + (this.$store.state.animatedMfm ? 'animation: tada 1s linear infinite both;' : '');
break;
}
case 'jelly': {
const speed = token.node.props.args.speed || '1s';
style = (this.$store.state.device.animatedMfm ? `animation: mfm-rubberBand ${speed} linear infinite both;` : '');
style = (this.$store.state.animatedMfm ? `animation: mfm-rubberBand ${speed} linear infinite both;` : '');
break;
}
case 'twitch': {
const speed = token.node.props.args.speed || '0.5s';
style = this.$store.state.device.animatedMfm ? `animation: mfm-twitch ${speed} ease infinite;` : '';
style = this.$store.state.animatedMfm ? `animation: mfm-twitch ${speed} ease infinite;` : '';
break;
}
case 'shake': {
const speed = token.node.props.args.speed || '0.5s';
style = this.$store.state.device.animatedMfm ? `animation: mfm-shake ${speed} ease infinite;` : '';
style = this.$store.state.animatedMfm ? `animation: mfm-shake ${speed} ease infinite;` : '';
break;
}
case 'spin': {
@ -110,15 +110,15 @@ export default defineComponent({
token.node.props.args.y ? 'mfm-spinY' :
'mfm-spin';
const speed = token.node.props.args.speed || '1.5s';
style = this.$store.state.device.animatedMfm ? `animation: ${anime} ${speed} linear infinite; animation-direction: ${direction};` : '';
style = this.$store.state.animatedMfm ? `animation: ${anime} ${speed} linear infinite; animation-direction: ${direction};` : '';
break;
}
case 'jump': {
style = this.$store.state.device.animatedMfm ? 'animation: mfm-jump 0.75s linear infinite;' : '';
style = this.$store.state.animatedMfm ? 'animation: mfm-jump 0.75s linear infinite;' : '';
break;
}
case 'bounce': {
style = this.$store.state.device.animatedMfm ? 'animation: mfm-bounce 0.75s linear infinite; transform-origin: center bottom;' : '';
style = this.$store.state.animatedMfm ? 'animation: mfm-bounce 0.75s linear infinite; transform-origin: center bottom;' : '';
break;
}
case 'flip': {

View File

@ -6,7 +6,7 @@
<XNoteHeader class="header" :note="note" :mini="true"/>
<div class="body">
<p v-if="note.cw != null" class="cw">
<Mfm v-if="note.cw != ''" class="text" :text="note.cw" :author="note.user" :i="$store.state.i" :custom-emojis="note.emojis" />
<Mfm v-if="note.cw != ''" class="text" :text="note.cw" :author="note.user" :i="$i" :custom-emojis="note.emojis" />
<XCwButton v-model:value="showContent" :note="note"/>
</p>
<div class="content" v-show="note.cw == null || showContent">

View File

@ -43,14 +43,14 @@
<MkInstanceTicker v-if="showTicker" class="ticker" :instance="appearNote.user.instance"/>
<div class="body">
<p v-if="appearNote.cw != null" class="cw">
<Mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis"/>
<Mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$i" :custom-emojis="appearNote.emojis"/>
<XCwButton v-model:value="showContent" :note="appearNote"/>
</p>
<div class="content" v-show="appearNote.cw == null || showContent">
<div class="text">
<span v-if="appearNote.isHidden" style="opacity: 0.5">({{ $t('private') }})</span>
<MkA class="reply" v-if="appearNote.replyId" :to="`/notes/${appearNote.replyId}`"><Fa :icon="faReply"/></MkA>
<Mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis"/>
<Mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :i="$i" :custom-emojis="appearNote.emojis"/>
<a class="rp" v-if="appearNote.renote != null">RN:</a>
</div>
<div class="files" v-if="appearNote.files.length > 0">
@ -182,7 +182,7 @@ export default defineComponent({
computed: {
rs() {
return this.$store.state.settings.reactions;
return this.$store.state.reactions;
},
keymap(): any {
return {
@ -222,11 +222,11 @@ export default defineComponent({
},
isMyNote(): boolean {
return this.$store.getters.isSignedIn && (this.$store.state.i.id === this.appearNote.userId);
return this.$i && (this.$i.id === this.appearNote.userId);
},
isMyRenote(): boolean {
return this.$store.getters.isSignedIn && (this.$store.state.i.id === this.note.userId);
return this.$i && (this.$i.id === this.note.userId);
},
canRenote(): boolean {
@ -262,14 +262,14 @@ export default defineComponent({
},
showTicker() {
if (this.$store.state.device.instanceTicker === 'always') return true;
if (this.$store.state.device.instanceTicker === 'remote' && this.appearNote.user.instance) return true;
if (this.$store.state.instanceTicker === 'always') return true;
if (this.$store.state.instanceTicker === 'remote' && this.appearNote.user.instance) return true;
return false;
}
},
async created() {
if (this.$store.getters.isSignedIn) {
if (this.$i) {
this.connection = os.stream;
}
@ -282,7 +282,7 @@ export default defineComponent({
this.$emit('update:note', Object.freeze(result));
}
this.muted = await checkWordMute(this.appearNote, this.$store.state.i, this.$store.state.settings.mutedWords);
this.muted = await checkWordMute(this.appearNote, this.$i, this.$store.state.mutedWords);
if (this.detail) {
os.api('notes/children', {
@ -305,7 +305,7 @@ export default defineComponent({
mounted() {
this.capture(true);
if (this.$store.getters.isSignedIn) {
if (this.$i) {
this.connection.on('_connected_', this.onStreamConnected);
}
},
@ -313,7 +313,7 @@ export default defineComponent({
beforeUnmount() {
this.decapture(true);
if (this.$store.getters.isSignedIn) {
if (this.$i) {
this.connection.off('_connected_', this.onStreamConnected);
}
},
@ -340,14 +340,14 @@ export default defineComponent({
},
capture(withHandler = false) {
if (this.$store.getters.isSignedIn) {
if (this.$i) {
this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
}
},
decapture(withHandler = false) {
if (this.$store.getters.isSignedIn) {
if (this.$i) {
this.connection.send('un', {
id: this.appearNote.id
});
@ -389,7 +389,7 @@ export default defineComponent({
[reaction]: currentCount + 1
};
if (body.userId === this.$store.state.i.id) {
if (body.userId === this.$i.id) {
n.myReaction = reaction;
}
@ -414,7 +414,7 @@ export default defineComponent({
[reaction]: Math.max(0, currentCount - 1)
};
if (body.userId === this.$store.state.i.id) {
if (body.userId === this.$i.id) {
n.myReaction = null;
}
@ -434,7 +434,7 @@ export default defineComponent({
choices[choice] = {
...choices[choice],
votes: choices[choice].votes + 1,
...(body.userId === this.$store.state.i.id ? {
...(body.userId === this.$i.id ? {
isVoted: true
} : {})
};
@ -614,7 +614,7 @@ export default defineComponent({
getMenu() {
let menu;
if (this.$store.getters.isSignedIn) {
if (this.$i) {
const statePromise = os.api('notes/state', {
noteId: this.appearNote.id
});
@ -649,7 +649,7 @@ export default defineComponent({
text: this.$t('clip'),
action: () => this.clip()
},
(this.appearNote.userId != this.$store.state.i.id) ? statePromise.then(state => state.isWatching ? {
(this.appearNote.userId != this.$i.id) ? statePromise.then(state => state.isWatching ? {
icon: faEyeSlash,
text: this.$t('unwatch'),
action: () => this.toggleWatch(false)
@ -658,7 +658,7 @@ export default defineComponent({
text: this.$t('watch'),
action: () => this.toggleWatch(true)
}) : undefined,
this.appearNote.userId == this.$store.state.i.id ? (this.$store.state.i.pinnedNoteIds || []).includes(this.appearNote.id) ? {
this.appearNote.userId == this.$i.id ? (this.$i.pinnedNoteIds || []).includes(this.appearNote.id) ? {
icon: faThumbtack,
text: this.$t('unpin'),
action: () => this.togglePin(false)
@ -667,7 +667,7 @@ export default defineComponent({
text: this.$t('pin'),
action: () => this.togglePin(true)
} : undefined,
...(this.$store.state.i.isModerator || this.$store.state.i.isAdmin ? [
...(this.$i.isModerator || this.$i.isAdmin ? [
null,
{
icon: faBullhorn,
@ -676,7 +676,7 @@ export default defineComponent({
}]
: []
),
...(this.appearNote.userId != this.$store.state.i.id ? [
...(this.appearNote.userId != this.$i.id ? [
null,
{
icon: faExclamationCircle,
@ -691,9 +691,9 @@ export default defineComponent({
}]
: []
),
...(this.appearNote.userId == this.$store.state.i.id || this.$store.state.i.isModerator || this.$store.state.i.isAdmin ? [
...(this.appearNote.userId == this.$i.id || this.$i.isModerator || this.$i.isAdmin ? [
null,
this.appearNote.userId == this.$store.state.i.id ? {
this.appearNote.userId == this.$i.id ? {
icon: faEdit,
text: this.$t('deleteAndEdit'),
action: this.delEdit

View File

@ -19,7 +19,7 @@
</XList>
<div v-show="more && !reversed" style="margin-top: var(--margin);">
<button class="_loadMore" v-appear="$store.state.device.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<button class="_loadMore" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('loadMore') }}</template>
<template v-if="moreFetching"><MkLoading inline/></template>
</button>

View File

@ -5,7 +5,7 @@
<XNotification v-else :notification="notification" :with-time="true" :full="true" class="_panel notification" :key="notification.id"/>
</XList>
<button class="_loadMore" v-appear="$store.state.device.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" v-show="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<button class="_loadMore" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" v-show="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('loadMore') }}</template>
<template v-if="moreFetching"><MkLoading inline/></template>
</button>
@ -59,7 +59,7 @@ export default defineComponent({
computed: {
allIncludeTypes() {
return this.includeTypes ?? notificationTypes.filter(x => !this.$store.state.i.mutingNotificationTypes.includes(x));
return this.includeTypes ?? notificationTypes.filter(x => !this.$i.mutingNotificationTypes.includes(x));
}
},
@ -70,9 +70,9 @@ export default defineComponent({
},
deep: true
},
// TODO: vue/vuexのバグか仕様かは不明なものの、プロフィール更新するなどして $store.state.i が更新されると、
// TODO: vue/vuexのバグか仕様かは不明なものの、プロフィール更新するなどして $i が更新されると、
// mutingNotificationTypes に変化が無くてもこのハンドラーが呼び出され無駄なリロードが発生するのを直す
'$store.state.i.mutingNotificationTypes': {
'$i.mutingNotificationTypes': {
handler() {
if (this.includeTypes === null) {
this.reload();

View File

@ -49,9 +49,9 @@ export default defineComponent({
canvas.toBlob(blob => {
const data = new FormData();
data.append('file', blob);
data.append('i', this.$store.state.i.token);
if (this.$store.state.settings.uploadFolder) {
data.append('folderId', this.$store.state.settings.uploadFolder);
data.append('i', this.$i.token);
if (this.$store.state.uploadFolder) {
data.append('folderId', this.$store.state.uploadFolder);
}
fetch(apiUrl + '/drive/files/create', {

View File

@ -1,6 +1,6 @@
<template>
<div class="mrdgzndn">
<Mfm :text="text" :is-note="false" :i="$store.state.i" :key="text"/>
<Mfm :text="text" :is-note="false" :i="$i" :key="text"/>
<MkUrlPreview v-for="url in urls" :url="url" :key="url" class="url"/>
</div>
</template>

View File

@ -35,9 +35,9 @@ export default defineComponent({
created() {
this.hpml = new Hpml(this.page, {
randomSeed: Math.random(),
visitor: this.$store.state.i,
visitor: this.$i,
url: url,
enableAiScript: !this.$store.state.device.disablePagesScript
enableAiScript: !this.$store.state.disablePagesScript
});
},

View File

@ -135,8 +135,8 @@ export default defineComponent({
poll: null,
useCw: false,
cw: null,
localOnly: this.$store.state.settings.rememberNoteVisibility ? this.$store.state.deviceUser.localOnly : this.$store.state.settings.defaultNoteLocalOnly,
visibility: this.$store.state.settings.rememberNoteVisibility ? this.$store.state.deviceUser.visibility : this.$store.state.settings.defaultNoteVisibility,
localOnly: this.$store.state.rememberNoteVisibility ? this.$store.state.localOnly : this.$store.state.defaultNoteLocalOnly,
visibility: this.$store.state.rememberNoteVisibility ? this.$store.state.visibility : this.$store.state.defaultNoteVisibility,
visibleUsers: [],
autocomplete: null,
draghover: false,
@ -198,7 +198,7 @@ export default defineComponent({
},
max(): number {
return this.$store.state.instance.meta ? this.$store.state.instance.meta.maxNoteTextLength : 1000;
return this.$instance ? this.$instance.maxNoteTextLength : 1000;
}
},
@ -223,8 +223,8 @@ export default defineComponent({
const mention = x.host ? `@${x.username}@${toASCII(x.host)}` : `@${x.username}`;
// 自分は除外
if (this.$store.state.i.username == x.username && x.host == null) continue;
if (this.$store.state.i.username == x.username && x.host == host) continue;
if (this.$i.username == x.username && x.host == null) continue;
if (this.$i.username == x.username && x.host == host) continue;
// 重複は除外
if (this.text.indexOf(`${mention} `) != -1) continue;
@ -243,12 +243,12 @@ export default defineComponent({
this.visibility = this.reply.visibility;
if (this.reply.visibility === 'specified') {
os.api('users/show', {
userIds: this.reply.visibleUserIds.filter(uid => uid !== this.$store.state.i.id && uid !== this.reply.userId)
userIds: this.reply.visibleUserIds.filter(uid => uid !== this.$i.id && uid !== this.reply.userId)
}).then(users => {
this.visibleUsers.push(...users);
});
if (this.reply.userId !== this.$store.state.i.id) {
if (this.reply.userId !== this.$i.id) {
os.api('users/show', { userId: this.reply.userId }).then(user => {
this.visibleUsers.push(user);
});
@ -262,7 +262,7 @@ export default defineComponent({
}
// keep cw when reply
if (this.$store.state.settings.keepCw && this.reply && this.reply.cw) {
if (this.$store.keepCw && this.reply && this.reply.cw) {
this.useCw = true;
this.cw = this.reply.cw;
}
@ -376,7 +376,7 @@ export default defineComponent({
},
upload(file: File, name?: string) {
os.upload(file, this.$store.state.settings.uploadFolder, name).then(res => {
os.upload(file, this.$store.state.uploadFolder, name).then(res => {
this.files.push(res);
});
},
@ -399,14 +399,14 @@ export default defineComponent({
}, {
changeVisibility: visibility => {
this.visibility = visibility;
if (this.$store.state.settings.rememberNoteVisibility) {
this.$store.commit('deviceUser/setVisibility', visibility);
if (this.$store.state.rememberNoteVisibility) {
this.$store.set('visibility', visibility);
}
},
changeLocalOnly: localOnly => {
this.localOnly = localOnly;
if (this.$store.state.settings.rememberNoteVisibility) {
this.$store.commit('deviceUser/setLocalOnly', localOnly);
if (this.$store.state.rememberNoteVisibility) {
this.$store.set('localOnly', localOnly);
}
}
}, 'closed');
@ -440,7 +440,7 @@ export default defineComponent({
const file = item.getAsFile();
const lio = file.name.lastIndexOf('.');
const ext = lio >= 0 ? file.name.slice(lio) : '';
const formatted = `${formatTimeString(new Date(file.lastModified), this.$store.state.settings.pastedFileName).replace(/{{number}}/g, `${i + 1}`)}${ext}`;
const formatted = `${formatTimeString(new Date(file.lastModified), this.$store.state.pastedFileName).replace(/{{number}}/g, `${i + 1}`)}${ext}`;
this.upload(file, formatted);
}
}

View File

@ -53,7 +53,7 @@ export default defineComponent({
},
computed: {
canToggle(): boolean {
return !this.reaction.match(/@\w/) && this.$store.getters.isSignedIn;
return !this.reaction.match(/@\w/) && this.$i;
},
},
watch: {

View File

@ -25,7 +25,7 @@ export default defineComponent({
},
computed: {
isMe(): boolean {
return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId;
return this.$i && this.$i.id === this.note.userId;
},
},
});

View File

@ -51,7 +51,7 @@ export default defineComponent({
text: '',
flag: false,
radio: 'misskey',
mfm: `Hello world! This is an @example mention. BTW you are @${this.$store.state.i.username}.\nAlso, here is ${config.url} and [example link](${config.url}). for more details, see https://example.com.\nAs you know #misskey is open-source software.`
mfm: `Hello world! This is an @example mention. BTW you are @${this.$i.username}.\nAlso, here is ${config.url} and [example link](${config.url}). for more details, see https://example.com.\nAs you know #misskey is open-source software.`
}
},

View File

@ -12,7 +12,7 @@
<nav class="nav" :class="{ iconOnly, hidden }" v-show="showing">
<div>
<button class="item _button account" @click="openAccountMenu">
<MkAvatar :user="$store.state.i" class="avatar"/><MkAcct class="text" :user="$store.state.i"/>
<MkAvatar :user="$i" class="avatar"/><MkAcct class="text" :user="$i"/>
</button>
<MkA class="item index" active-class="active" to="/" exact>
<Fa :icon="faHome" fixed-width/><span class="text">{{ $t('timeline') }}</span>
@ -25,7 +25,7 @@
</component>
</template>
<div class="divider"></div>
<button class="item _button" :class="{ active: $route.path === '/instance' || $route.path.startsWith('/instance/') }" v-if="$store.state.i.isAdmin || $store.state.i.isModerator" @click="oepnInstanceMenu">
<button class="item _button" :class="{ active: $route.path === '/instance' || $route.path.startsWith('/instance/') }" v-if="$i.isAdmin || $i.isModerator" @click="oepnInstanceMenu">
<Fa :icon="faServer" fixed-width/><span class="text">{{ $t('instance') }}</span>
</button>
<button class="item _button" @click="more">
@ -49,6 +49,7 @@ import { host } from '@/config';
import { search } from '@/scripts/search';
import * as os from '@/os';
import { sidebarDef } from '@/sidebar';
import { getAccounts, addAccount, login } from '@/account';
export default defineComponent({
data() {
@ -67,7 +68,7 @@ export default defineComponent({
computed: {
menu(): string[] {
return this.$store.state.deviceUser.menu;
return this.$store.state.menu;
},
otherNavItemIndicated(): boolean {
@ -84,7 +85,7 @@ export default defineComponent({
this.showing = false;
},
'$store.state.device.sidebarDisplay'() {
'$store.reactiveState.sidebarDisplay'() {
this.calcViewState();
},
@ -108,8 +109,8 @@ export default defineComponent({
methods: {
calcViewState() {
this.iconOnly = (window.innerWidth <= 1279) || (this.$store.state.device.sidebarDisplay === 'icon');
this.hidden = (window.innerWidth <= 650) || (this.$store.state.device.sidebarDisplay === 'hide');
this.iconOnly = (window.innerWidth <= 1279) || (this.$store.state.sidebarDisplay === 'icon');
this.hidden = (window.innerWidth <= 650);
},
show() {
@ -133,7 +134,8 @@ export default defineComponent({
},
async openAccountMenu(ev) {
const accounts = (await os.api('users/show', { userIds: this.$store.state.device.accounts.map(x => x.id) })).filter(x => x.id !== this.$store.state.i.id);
const storedAccounts = getAccounts();
const accounts = (await os.api('users/show', { userIds: storedAccounts.map(x => x.id) })).filter(x => x.id !== this.$i.id);
const accountItems = accounts.map(account => ({
type: 'user',
@ -144,8 +146,8 @@ export default defineComponent({
os.modalMenu([...[{
type: 'link',
text: this.$t('profile'),
to: `/@${ this.$store.state.i.username }`,
avatar: this.$store.state.i,
to: `/@${ this.$i.username }`,
avatar: this.$i,
}, null, ...accountItems, {
icon: faPlus,
text: this.$t('addAcount'),
@ -169,7 +171,7 @@ export default defineComponent({
text: this.$t('dashboard'),
to: '/instance',
icon: faTachometerAlt,
}, null, this.$store.state.i.isAdmin ? {
}, null, this.$i.isAdmin ? {
type: 'link',
text: this.$t('settings'),
to: '/instance/settings',
@ -230,7 +232,7 @@ export default defineComponent({
addAcount() {
os.popup(import('./signin-dialog.vue'), {}, {
done: res => {
this.$store.dispatch('addAcount', res);
addAccount(res.id, res.i);
os.success();
},
}, 'closed');
@ -239,30 +241,20 @@ export default defineComponent({
createAccount() {
os.popup(import('./signup-dialog.vue'), {}, {
done: res => {
this.$store.dispatch('addAcount', res);
addAccount(res.id, res.i);
this.switchAccountWithToken(res.i);
},
}, 'closed');
},
switchAccount(account: any) {
const token = this.$store.state.device.accounts.find((x: any) => x.id === account.id).token;
const storedAccounts = getAccounts();
const token = storedAccounts.find(x => x.id === account.id).token;
this.switchAccountWithToken(token);
},
switchAccountWithToken(token: string) {
os.waiting();
os.api('i', {}, token).then((i: any) => {
this.$store.dispatch('switchAccount', {
...i,
token: token
}).then(() => {
this.$nextTick(() => {
location.reload();
});
});
});
login(token);
},
}
});

View File

@ -56,6 +56,7 @@ import MkInput from './ui/input.vue';
import { apiUrl, host } from '@/config';
import { byteify, hexify } from '@/scripts/2fa';
import * as os from '@/os';
import { login } from '@/account';
export default defineComponent({
components: {
@ -97,7 +98,7 @@ export default defineComponent({
computed: {
meta() {
return this.$store.state.instance.meta;
return this.$instance;
},
},
@ -114,8 +115,7 @@ export default defineComponent({
onLogin(res) {
if (this.autoSet) {
localStorage.setItem('i', res.i);
location.reload();
login(res.i);
}
},

View File

@ -59,6 +59,7 @@ import MkButton from './ui/button.vue';
import MkInput from './ui/input.vue';
import MkSwitch from './ui/switch.vue';
import * as os from '@/os';
import { login } from '@/account';
export default defineComponent({
components: {
@ -99,7 +100,7 @@ export default defineComponent({
computed: {
meta() {
return this.$store.state.instance.meta;
return this.$instance;
},
shouldDisableSubmitting(): boolean {
@ -184,8 +185,7 @@ export default defineComponent({
this.$emit('signup', res);
if (this.autoSet) {
localStorage.setItem('i', res.i);
location.reload();
login(res.i);
}
});
}).catch(() => {

View File

@ -4,7 +4,7 @@
<span v-if="note.isHidden" style="opacity: 0.5">({{ $t('private') }})</span>
<span v-if="note.deletedAt" style="opacity: 0.5">({{ $t('deleted') }})</span>
<MkA class="reply" v-if="note.replyId" :to="`/notes/${note.replyId}`"><Fa :icon="faReply"/></MkA>
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$store.state.i" :custom-emojis="note.emojis"/>
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$i" :custom-emojis="note.emojis"/>
<MkA class="rp" v-if="note.renoteId" :to="`/notes/${note.renoteId}`">RN: ...</MkA>
</div>
<details v-if="note.files.length > 0">

View File

@ -1,5 +1,5 @@
<template>
<XNotes :class="{ _noGap_: !$store.state.device.showGapBetweenNotesInTimeline }" ref="tl" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)" @queue="$emit('queue', $event)"/>
<XNotes :class="{ _noGap_: !$store.state.showGapBetweenNotesInTimeline }" ref="tl" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)" @queue="$emit('queue', $event)"/>
</template>
<script lang="ts">
@ -51,9 +51,9 @@ export default defineComponent({
connection2: null,
pagination: null,
baseQuery: {
includeMyRenotes: this.$store.state.settings.showMyRenotes,
includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes,
includeLocalRenotes: this.$store.state.settings.showLocalRenotes
includeMyRenotes: this.$store.state.showMyRenotes,
includeRenotedMyNotes: this.$store.state.showRenotedMyNotes,
includeLocalRenotes: this.$store.state.showLocalRenotes
},
query: {},
};
@ -66,7 +66,7 @@ export default defineComponent({
this.$emit('note');
if (this.sound) {
sound.play(note.userId === this.$store.state.i.id ? 'noteMy' : 'note');
sound.play(note.userId === this.$i.id ? 'noteMy' : 'note');
}
};

View File

@ -1,5 +1,5 @@
<template>
<transition :name="$store.state.device.animation ? 'fade' : ''" appear>
<transition :name="$store.state.animation ? 'fade' : ''" appear>
<div class="nvlagfpb" @contextmenu.prevent.stop="() => {}">
<MkMenu :items="items" @close="$emit('closed')" class="_popup _shadow" :align="'left'"/>
</div>

View File

@ -1,10 +1,10 @@
<template>
<div class="mk-modal" v-hotkey.global="keymap" :style="{ pointerEvents: showing ? 'auto' : 'none', '--transformOrigin': transformOrigin }">
<transition :name="$store.state.device.animation ? 'modal-bg' : ''" appear>
<transition :name="$store.state.animation ? 'modal-bg' : ''" appear>
<div class="bg _modalBg" v-if="showing" @click="onBgClick"></div>
</transition>
<div class="content" :class="{ popup, fixed, top: position === 'top' }" @click.self="onBgClick" ref="content">
<transition :name="$store.state.device.animation ? popup ? 'modal-popup-content' : 'modal-content' : ''" appear @after-leave="$emit('closed')" @after-enter="childRendered">
<transition :name="$store.state.animation ? popup ? 'modal-popup-content' : 'modal-content' : ''" appear @after-leave="$emit('closed')" @after-enter="childRendered">
<slot v-if="showing"></slot>
</transition>
</div>

View File

@ -5,7 +5,7 @@
<slot name="empty"></slot>
</div>
<div class="more" v-show="more" key="_more_">
<MkButton class="button" v-appear="$store.state.device.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary>
<MkButton class="button" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary>
<template v-if="!moreFetching">{{ $t('loadMore') }}</template>
<template v-if="moreFetching"><MkLoading inline/></template>
</MkButton>

View File

@ -1,5 +1,5 @@
<template>
<transition :name="$store.state.device.animation ? 'window' : ''" appear @after-leave="$emit('closed')">
<transition :name="$store.state.animation ? 'window' : ''" appear @after-leave="$emit('closed')">
<div class="ebkgocck" v-if="showing">
<div class="body _popup _shadow _narrow_" @mousedown="onBodyMousedown" @keydown="onKeydown">
<div class="header" @contextmenu.prevent.stop="onContextmenu">

View File

@ -4,7 +4,7 @@
<iframe :src="player.url + (player.url.match(/\?/) ? '&autoplay=1&auto_play=1' : '?autoplay=1&auto_play=1')" :width="player.width || '100%'" :heigth="player.height || 250" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen />
</div>
<div v-else-if="tweetId && tweetExpanded" class="twitter" ref="twitter">
<iframe ref="tweet" scrolling="no" frameborder="no" :style="{ position: 'relative', left: `${tweetLeft}px`, width: `${tweetLeft < 0 ? 'auto' : '100%'}`, height: `${tweetHeight}px` }" :src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&amp;hideCard=false&amp;hideThread=false&amp;lang=en&amp;theme=${$store.state.device.darkMode ? 'dark' : 'light'}&amp;id=${tweetId}`"></iframe>
<iframe ref="tweet" scrolling="no" frameborder="no" :style="{ position: 'relative', left: `${tweetLeft}px`, width: `${tweetLeft < 0 ? 'auto' : '100%'}`, height: `${tweetHeight}px` }" :src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&amp;hideCard=false&amp;hideThread=false&amp;lang=en&amp;theme=${$store.state.darkMode ? 'dark' : 'light'}&amp;id=${tweetId}`"></iframe>
</div>
<div v-else class="mk-url-preview" v-size="{ max: [400, 350] }">
<transition name="zoom" mode="out-in">

View File

@ -8,7 +8,7 @@
</div>
<div class="description">
<div class="mfm" v-if="user.description">
<Mfm :text="user.description" :author="user" :i="$store.state.i" :custom-emojis="user.emojis"/>
<Mfm :text="user.description" :author="user" :i="$i" :custom-emojis="user.emojis"/>
</div>
<span v-else style="opacity: 0.7;">{{ $t('noAccountDescription') }}</span>
</div>
@ -23,7 +23,7 @@
<p>{{ $t('followers') }}</p><span>{{ user.followersCount }}</span>
</div>
</div>
<MkFollowButton class="koudoku-button" v-if="$store.getters.isSignedIn && user.id != $store.state.i.id" :user="user" mini/>
<MkFollowButton class="koudoku-button" v-if="$i && user.id != $i.id" :user="user" mini/>
</div>
</template>

View File

@ -8,7 +8,7 @@
<div class="users">
<MkUserInfo class="user" v-for="user in users" :user="user" :key="user.id"/>
</div>
<button class="more" v-appear="$store.state.device.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :class="{ fetching: moreFetching }" v-show="more" :disabled="moreFetching">
<button class="more" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :class="{ fetching: moreFetching }" v-show="more" :disabled="moreFetching">
<template v-if="moreFetching"><Fa icon="spinner" pulse fixed-width/></template>{{ moreFetching ? $t('loading') : $t('loadMore') }}
</button>
</div>

View File

@ -9,7 +9,7 @@
<p class="username"><MkAcct :user="user"/></p>
</div>
<div class="description">
<Mfm v-if="user.description" :text="user.description" :author="user" :i="$store.state.i" :custom-emojis="user.emojis"/>
<Mfm v-if="user.description" :text="user.description" :author="user" :i="$i" :custom-emojis="user.emojis"/>
</div>
<div class="status">
<div>
@ -22,7 +22,7 @@
<p>{{ $t('followers') }}</p><span>{{ user.followersCount }}</span>
</div>
</div>
<MkFollowButton class="koudoku-button" v-if="$store.getters.isSignedIn && user.id != $store.state.i.id" :user="user" mini/>
<MkFollowButton class="koudoku-button" v-if="$i && user.id != $i.id" :user="user" mini/>
</div>
<div v-else>
<MkLoading/>

View File

@ -79,7 +79,7 @@ export default defineComponent({
});
this.recentUsers = await os.api('users/show', {
userIds: this.$store.state.device.recentlyUsedUsers
userIds: this.$store.state.recentlyUsedUsers
});
},
@ -108,10 +108,10 @@ export default defineComponent({
this.$refs.dialog.close();
// 最近使ったユーザー更新
let recents = this.$store.state.device.recentlyUsedUsers;
let recents = this.$store.state.recentlyUsedUsers;
recents = recents.filter(x => x !== this.selected.id);
recents.unshift(this.selected.id);
this.$store.commit('device/set', { key: 'recentlyUsedUsers', value: recents.splice(0, 16) });
this.$store.set('recentlyUsedUsers', recents.splice(0, 16));
},
cancel() {

View File

@ -14,7 +14,7 @@
</div>
</MkA>
</div>
<button class="more _button" v-appear="$store.state.device.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" v-show="more" :disabled="moreFetching">
<button class="more _button" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" v-show="more" :disabled="moreFetching">
<template v-if="!moreFetching">{{ $t('loadMore') }}</template>
<template v-if="moreFetching"><Fa :icon="faSpinner" pulse fixed-width/></template>
</button>