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

@@ -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